简体   繁体   English

为什么 Facebook PHP SDK getUser 总是返回 0?

[英]Why is Facebook PHP SDK getUser always returning 0?

I'm trying to work with a website that requires some information from a Facebook user, I'm using PHP and JS SDKs.我正在尝试使用需要来自 Facebook 用户的一些信息的网站,我正在使用 PHP 和 JS SDK。

I have a function in PHP:我在 PHP 中有一个 function:

public function isLoggedOnFacebook() {
    $user = $this->_facebook->getUser();
    if ($user) {
        return $this->_facebook->api("/$user");
    }
    return false;
}

On a class that is holding the facebook object from the SDK in $this->_facebook .在 class 上,该 class 持有 facebook object 来自$this->_facebook 9 中的 ZF20E3C5E54C0AB3D3765D660B3F8 中的 object。

Then on a block I do this:然后在一个块上我这样做:

<?php if (!$this->isLoggedOnFacebook()): ?>
<div>
   <fb:login-button show-faces="true" perms="email" width="500" />
</div>
<?php endif ?>

And the FB JS environment is properly set up (I think) so it works.并且 FB JS 环境设置正确(我认为)所以它可以工作。 So the user gets the pop up and authorizes the site.因此,用户会弹出并授权该站点。

The problem is even after the app is been authorized by the user $user is always 0, meaning $facebook->getUser() always returns 0, and then lists the faces of users, including the logged user, but if I make it call $facebook->api('/me') or whatever, then it'll throw the invalid token exception.问题是即使应用程序被用户授权后 $user 始终为 0,这意味着$facebook->getUser()始终返回 0,然后列出用户的面孔,包括登录的用户,但如果我让它调用$facebook->api('/me')或其他,然后它会抛出无效的令牌异常。

I've seen this problem, but I haven't seen a solution, I have no idea where the problem is and I run out of ideas.我已经看到了这个问题,但我还没有看到解决方案,我不知道问题出在哪里,而且我的想法已经用完了。

There's a Website tab on the developers' Facebook page in the apps section, where you can set up your Site URL and your Site Domain, and I'm thinking this are the cause of my problem, but I have no knowledge of exactly what these fields are supposed to contain.在应用程序部分的开发人员的 Facebook 页面上有一个网站选项卡,您可以在其中设置您的站点 URL 和您的站点域,我认为这是我的问题的原因,但我不知道这些到底是什么字段应该包含。

I had the same problem and I figured it out that is because SDK uses the variable $_REQUEST and in my environment is not true that is merged with $_GET , $_POST and $_COOKIE variables.我遇到了同样的问题,我发现这是因为 SDK 使用变量$_REQUEST并且在我的环境中与$_GET$_POST$_COOKIE变量合并的情况并非如此。

I think it depends on the PHP version and that is why someone made it work by enabling cookies.我认为这取决于 PHP 版本,这就是为什么有人通过启用 cookies 使其工作的原因。

I found this code in base_facebook.php:我在 base_facebook.php 中找到了这段代码:

protected function getCode() {
    if (isset($_REQUEST['code'])) {
        if ($this->state !== null &&
                isset($_REQUEST['state']) &&
                $this->state === $_REQUEST['state']) {

            // CSRF state has done its job, so clear it
            $this->state = null;
            $this->clearPersistentData('state');
            return $_REQUEST['code'];
        } else {
            self::errorLog('CSRF state token does not match one provided.');
            return false;
        }
    }

    return false;
}

And I modified it as you can see below by creating $server_info variable.我通过创建 $server_info 变量对其进行了修改,如下所示。

protected function getCode() {
    $server_info = array_merge($_GET, $_POST, $_COOKIE);

    if (isset($server_info['code'])) {
        if ($this->state !== null &&
                isset($server_info['state']) &&
                $this->state === $server_info['state']) {

            // CSRF state has done its job, so clear it
            $this->state = null;
            $this->clearPersistentData('state');
            return $server_info['code'];
        } else {
            self::errorLog('CSRF state token does not match one provided.');
            return false;
        }
    }

    return false;
}

I ran into similar problem.我遇到了类似的问题。 $facebook->getUser() was returning 0 and sometimes it returned valid user id when user wasn't actually logged in, resulting in Fatal Oauth error when I tried to make graph api calls. $facebook->getUser() 返回 0,有时它在用户未实际登录时返回有效的用户 ID,导致当我尝试进行图形 api 调用时出现致命的 Oauth 错误。 I finally solved this problem.我终于解决了这个问题。 I don't know if it is the right way but it works.我不知道这是否是正确的方法,但它有效。 Here is the code:这是代码:

<?php
include 'includes/php/facebook.php';
$app_id = "APP_ID";
$app_secret = "SECRET_KEY";
$facebook = new Facebook(array(
    'appId' => $app_id,
    'secret' => $app_secret,
    'cookie' => true
));

$user = $facebook->getUser();

if ($user <> '0' && $user <> '') { /*if valid user id i.e. neither 0 nor blank nor null*/
try {
// Proceed knowing you have a logged in user who's authenticated.
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) { /*sometimes it shows user id even if user in not logged in and it results in Oauth exception. In this case we will set it back to 0.*/
error_log($e);
$user = '0';
}
}
if ($user <> '0' && $user <> '') { /*So now we will have a valid user id with a valid oauth access token and so the code will work fine.*/
echo "UserId : " . $user;

$params = array( 'next' => 'http://www.anujkumar.com' );
echo "<p><a href='". $facebook->getLogoutUrl($params) . "'>Logout</a>";

$user_profile = $facebook->api('/me');
echo "<p>Name : " . $user_profile['name'];
echo "<p>";
print_r($user_profile);

} else {/*If user id isn't present just redirect it to login url*/
header("Location:{$facebook->getLoginUrl(array('req_perms' => 'email,offline_access'))}");
}

?>

You need to ensure that your app is set to pick up the code parameter from the Query String rather than the uri_fragment, this can be set on facebook apps page apps>settings>permissions .您需要确保您的应用程序设置为从查询字符串而不是 uri_fragment 中获取代码参数,这可以在 facebook 应用程序页面apps>settings>permissions上设置。

That did it for me using $facebook->getLoginUrl() to provide the login URL.使用$facebook->getLoginUrl()为我提供了登录 URL。

Check your config array.检查您的配置数组。 Ensure that you are using proper string encaps quotes when setting the values.确保在设置值时使用正确的字符串封装引号。

$config = array();
$config["appId"] = $APP_ID;
$config["secret"] = $APP_SECRET;
$config["fileUpload"] = false; // optional

This works.这行得通。

$config = array();
$config[‘appId’] = 'YOUR_APP_ID';
$config[‘secret’] = 'YOUR_APP_SECRET';
$config[‘fileUpload’] = false; // optional

This is a direct copy/paste from the website http://developers.facebook.com/docs/reference/php/ and does NOT work because of the odd squiggly quotes.这是从网站http://developers.facebook.com/docs/reference/php/直接复制/粘贴,并且由于奇怪的波浪状引号而不起作用。

the long answer is that your hash for your "checking" of the app signature is not coming out to a correct check, because the app secret is not returning a valid value (it's returning nothing, actually)... so the hash_hmac function is returning an incorrect value that doesn't match properly, etc...长答案是您的 hash 用于“检查”应用程序签名没有得到正确检查,因为应用程序机密没有返回有效值(实际上它什么也没返回)......所以 hash_hmac function 是返回不正确匹配的不正确值等...

After debugging through the base_facebook.php I found, because somehow I had lost my.crt file the access token is forever invalid.通过 base_facebook.php 调试后,我发现,因为不知何故我丢失了 my.crt 文件,访问令牌永远无效。 Make sure you have your fb_ca_chain_bundle.crt available at: https://github.com/facebook/facebook-php-sdk/blob/master/src/fb_ca_chain_bundle.crt确保您的 fb_ca_chain_bundle.crt 位于: https://github.com/facebook/facebook-php-sdk/blob/master/src/fb_ca_chain_bundle.crt

Hours and hours down the drain.几小时又一小时的下水道。 None of the posts about this on Stack Overflow or other sites provided the solution to my problem. Stack Overflow 或其他网站上关于此的帖子都没有为我的问题提供解决方案。 I finally went in to the library code and figured out exactly where it was dying.我终于进入了库代码,并弄清楚了它到底在哪里死了。

On my development machine, which uses XAMPP for Windows, I kept getting the 0 for logging in, while my test server would work properly.在我的开发机器上,它使用 XAMPP 作为 Windows,我一直得到 0 来登录,而我的测试服务器可以正常工作。 After realizing an exception was being thrown but hidden, I put an $e->getMessage() in base_facebook.php, which pointed out I was having an SSL error.在意识到异常被抛出但被隐藏后,我在 base_facebook.php 中放置了一个 $e->getMessage(),它指出我遇到了 SSL 错误。 The following post, HTTPS and SSL3_GET_SERVER_CERTIFICATE:certificate verify failed, CA is OK , led me to a solution.以下帖子HTTPS 和 SSL3_GET_SERVER_CERTIFICATE:certificate verify failed, CA is OK让我找到了解决方案。

The solution:解决方案:

In base_facebook.php, add the following before curl_exec($ch):在 base_facebook.php 中,在 curl_exec($ch) 之前添加以下内容:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

You should probably wrap the above in whatever flags you use to determine if you are in development mode, because you won't want the above line in a production system.您可能应该将以上内容包装在您用来确定是否处于开发模式的任何标志中,因为您不希望在生产系统中使用上述行。 For instance:例如:

if ( getenv( 'environment' ) === 'development' ) {
    curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
}

Try this in your piece of code: on if condition true you'll be reirected to facebook then login yourself and i hope you'll good to go by then but remember use new libraries of php SDK Try this in your piece of code: on if condition true you'll be reirected to facebook then login yourself and i hope you'll good to go by then but remember use new libraries of php SDK

if(($facebook->getUser())==0)
{
 header("Location:{$facebook->getLoginUrl(array('scope' => 'photo_upload,user_status,publish_stream,user_photos,manage_pages'))}");
 exit;
}
else {
$accounts_list = $facebook->api('/me/accounts');
echo "i am connected";
}

I was having the exact same problem on my Facebook app, and I finally figured it out after 2 days of hair pulling frustration.我在我的 Facebook 应用程序上遇到了完全相同的问题,经过 2 天的拉扯挫折后,我终于弄明白了。 It turned out to be an issue with the redirect-uri in the getLoginUrl() , if it doesn't match the registered app domain through facebook, they return the error.原来是getLoginUrl()中的 redirect-uri 存在问题,如果它与通过 facebook 注册的应用程序域不匹配,它们会返回错误。 and the user gets returned as 0 (the default user value).并且用户返回为 0(默认用户值)。

i solved this as i faced the same problem.我解决了这个问题,因为我面临同样的问题。 Just goto developers.facebook.com/apps then navigate to your app hit EDIT APP button只需转到 developers.facebook.com/apps 然后导航到您的应用程序点击编辑应用程序按钮

IF you have check "App on facebook" and have entered a canvas url to it the app will not work out side the facebook will work under apps.facebook.com/ IF you have check "App on facebook" and have entered a canvas url to it the app will not work out side the facebook will work under apps.facebook.com/

just remove this check it worked for me只需删除此检查它对我有用

$facebook->getUser() will return 0, if the user doesn't authenticate the app.如果用户没有验证应用程序, $facebook->getUser()将返回 0。

use $facebook->getLoginUrl to get the URL to authenticate the app.使用$facebook->getLoginUrl获取 URL 来验证应用程序。

<?php

require 'facebook.php';

// Create our application instance
// (replace this with your appId and secret).
$facebook = new Facebook(array(
  'appId'  => 'YOUR_APP_ID',
  'secret' => 'YOUR_APP_SECRET',
));

// Get User ID
$user = $facebook->getUser();

// We may or may not have this data based 
// on whether the user is logged in.
// If we have a $user id here, it means we know 
// the user is logged into
// Facebook, but we don’t know if the access token is valid. An access
// token is invalid if the user logged out of Facebook.

if ($user) {
  try {
    // Proceed knowing you have a logged in user who's authenticated.
    $user_profile = $facebook->api('/me');
  } catch (FacebookApiException $e) {
    error_log($e);
    $user = null;
  }
}

// Login or logout url will be needed depending on current user state.
if ($user) {
  $logoutUrl = $facebook->getLogoutUrl();
} else {
  $loginUrl = $facebook->getLoginUrl();
}

// This call will always work since we are fetching public data.
$naitik = $facebook->api('/naitik');

?>
<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
  <head>
    <title>php-sdk</title>
    <style>
      body {
        font-family: 'Lucida Grande', Verdana, Arial, sans-serif;
      }
      h1 a {
        text-decoration: none;
        color: #3b5998;
      }
      h1 a:hover {
        text-decoration: underline;
      }
    </style>
  </head>
  <body>
    <h1>php-sdk</h1>

    <?php if ($user): ?>
      <a href="<?php echo $logoutUrl; ?>">Logout</a>
    <?php else: ?>
      <div>
        Login using OAuth 2.0 handled by the PHP SDK:
        <a href="<?php echo $loginUrl; ?>">Login with Facebook</a>
      </div>
    <?php endif ?>

    <h3>PHP Session</h3>
    <pre><?php print_r($_SESSION); ?></pre>

    <?php if ($user): ?>
      <h3>You</h3>
      <img src="https://graph.facebook.com/<?php echo $user; ?>/picture">

      <h3>Your User Object (/me)</h3>
      <pre><?php print_r($user_profile); ?></pre>
    <?php else: ?>
      <strong><em>You are not Connected.</em></strong>
    <?php endif ?>

    <h3>Public profile of Naitik</h3>
    <img src="https://graph.facebook.com/naitik/picture">
    <?php echo $naitik['name']; ?>
  </body>
</html>

I had same problem with getUser() , It returns 0 in IE 8. I found a solution after doing some research.我与getUser()有同样的问题,它在 IE 8 中返回 0。我在做了一些研究后找到了解决方案。 Follow the link below.按照下面的链接。 This worked like a charm.这就像一个魅力。

http://www.andugo.com/facebook-php-sdk-getuser-return-0-value-on-ie/ http://www.andugo.com/facebook-php-sdk-getuser-return-0-value-on-ie/

After some desperate hours, here is what caused the same issue on my server: If you use SSL, make sure that port 443 is not blocked , I opened the port last year.经过几个小时的绝望,这就是在我的服务器上引起同样问题的原因:如果您使用 SSL,请确保端口 443 没有被阻塞,我去年打开了该端口。 but it appeared that my webhoster somehow did a reset recently.但似乎我的虚拟主机最近以某种方式进行了重置。

I checked and test a long time, Now I found the reason.查了很久,终于找到原因了。

Please login developer apps, in settings --> Advance --> Migrations --> Deprecate offline access- -> disabled .请登录开发者应用程序,在设置-->高级-->迁移-->弃用离线访问-->禁用

You will find $facebook->getUser() will work.你会发现 $facebook->getUser() 会起作用。

another thing.另一件事。 had better add domain when new the facebook class;最好在新 facebook class 时添加域;

$facebook = new Facebook(array(
'appId' => APP_ID,//$app_id,
'secret' => APP_SECRET,//$app_secret,
'cookie' => true,
'domain'=>'xxxdomain.com',
));
$session = $facebook->getUser();    

A facebook->getUser() will return 0 when there is no logged-in user.当没有登录用户时,facebook->getUser() 将返回 0。 (https://developers.facebook.com/docs/reference/php/facebook-getUser/) (https://developers.facebook.com/docs/reference/php/facebook-getUser/)

To resolve this, the Facebook JS SDK provides an access token from a successful login which you can use with the Facebook PHP SDK. To resolve this, the Facebook JS SDK provides an access token from a successful login which you can use with the Facebook PHP SDK.

The javascript below will check whether or not a Facebook login already exists and your Facebook App is authorized:下面的 javascript 将检查 Facebook 登录是否已经存在以及您的 Facebook 应用程序是否已获得授权:

FB.getLoginStatus(function($response) {
    if ($response.status === 'connected') {
        var uid = $response.authResponse.userID;
        var accessToken = $response.authResponse.accessToken;
        _accessServer(uid, accessToken);

    } else if ($response.status === 'not_authorized') {
        _loginPopup();

    } else {
        _loginPopup();
    }
});

The function _accessServer opens another request back to your server, sending the access token. function _accessServer 向您的服务器打开另一个请求,发送访问令牌。

The function _loginPopup should open the Facebook login popup requesting the appropriate permissions for the user to "allow access" to your application. function _loginPopup 应打开 Facebook 登录弹出窗口,请求用户“允许访问”您的应用程序的适当权限。

The PHP application should then pass the access token back to the Facebook API:然后 PHP 应用程序应将访问令牌传递回 Facebook API:

$facebook->setAccessToken($new_access_token);
$uid = $facebook->getUser();

https://developers.facebook.com/docs/reference/php/facebook-setAccessToken/ https://developers.facebook.com/docs/reference/php/facebook-setAccessToken/

Hope that helps.希望有帮助。

Adding this line solved this problem for me in IE9:添加这一行为我在 IE9 中解决了这个问题:

header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"'); // This is the main cause to use on IE.

If this question is still relevant to people, I'd like to contribute my 2 cents as I struggled quite some time to get things working.如果这个问题仍然与人们相关,我想贡献我的 2 美分,因为我努力了很长时间才能让事情正常进行。

First of all, try out the SDK that would suit you, whether it be PHP or JS.首先,试用适合您的 SDK,无论是 PHP 还是 JS。 In essence they both do the same stuff, it's just that JS might handle it a bit more elegant (with the pop-up dialog and what not).本质上,它们都做同样的事情,只是 JS 可能会处理得更优雅一些(弹出对话框等等)。 There's a lot of different tutorials, manuals and examples out there.那里有很多不同的教程、手册和示例。 It took me like a week to find 1 that suited me and that I could actually use, Once you've found the piece of code that works with the SDK you plan on using.我花了大约一周的时间找到适合我并且我可以实际使用的 1,一旦你找到了与你计划使用的 SDK 一起工作的代码。 it's time for you to alter the code to your specific needs.现在是时候根据您的特定需求更改代码了。

Once I had finished my code, I started testing it.一旦我完成了我的代码,我就开始测试它。 I noticed I was running my code on localhost, and I too was getting no result from my arrays.我注意到我在 localhost 上运行我的代码,我的 arrays 也没有得到任何结果。 To answer your question: upload your code to a (sub)domain and try again.要回答您的问题:将您的代码上传到(子)域,然后重试。 My code worked all the time, but because I did not have it online, it didn't work.我的代码一直都在工作,但是因为我没有在线,所以它没有工作。 If you already got it online, then my answer is not of use to you.如果你已经上网了,那么我的回答对你没有用。

I'm sorry if this kind of small story isn't really meant to be on SO, but it might help people.很抱歉,如果这种小故事不是真的要在 SO 上播放,但它可能会对人们有所帮助。

Good luck!祝你好运!

    if ($facebook->getUser()) {
       $userProfile = $facebook->api('/me');
       // do logic
    } else {
       $loginUrl = $facebook->getLoginUrl($params = array('scope' => SCOPE));
       header('Location:' . $loginUrl);
    }

that how i fixed my problem, now it is returning me the detail of user profile for further processing.我是如何解决我的问题的,现在它正在向我返回用户配置文件的详细信息以供进一步处理。 (it was such a headache) (真是头疼)

These are good suggestions but the thing that worked for me is on Facebook itself.这些都是很好的建议,但对我有用的是 Facebook 本身。 After refactoring the code many times I realized it's a problem with the configurations on Facebook.多次重构代码后,我意识到这是Facebook上的配置问题。
The following steps resolved my issue.以下步骤解决了我的问题。

1.) Under Basic > App on Facebook... I deselected that although you can leave it if you want 1.)在 Facebook 上的基本 > 应用程序下...我取消了选择,尽管您可以根据需要离开它

2.) Under Permissions > Privacy -> set to Public 2.)在权限>隐私->设置为公共

Permissions > Auth Token -> set to Query String权限 > Auth Token -> 设置为查询字符串

3.) Under Advanced -> Authentication > App Type -> Web 3.) 在高级 -> 身份验证 > 应用程序类型 -> Web

The third step is the one that really fixed it all, not completely sure why though, hope that helps第三步是真正解决所有问题的步骤,但不完全确定为什么,希望对您有所帮助

Make sure you call this Facebook API-function getUser before any output, because it uses Session variables and Cookies.确保在任何 output之前调用此 Facebook API 函数 getUser,因为它使用 Session 变量和 Z597B56E53834612AAC Headers can not be sent/read correctly if you did.如果您这样做,则无法正确发送/读取标题。

I also spent many hours looking at this and also found a solution.我还花了很多时间研究这个问题并找到了解决方案。 Might not be for you but it seems there is some issue with $_SERVER['QUERY_STRING'] so you need to set it into the $_REQUEST array.可能不适合您,但似乎 $_SERVER['QUERY_STRING'] 存在一些问题,因此您需要将其设置到 $_REQUEST 数组中。

I was using codeigniter and found that the following code above the library load worked.我正在使用 codeigniter 并发现库加载上方的以下代码有效。

parse_str($_SERVER['QUERY_STRING'],$_REQUEST); parse_str($_SERVER['QUERY_STRING'],$_REQUEST);

    parse_str($_SERVER['QUERY_STRING'],$_REQUEST);
    $config = array(); 
    $config["appId"] = "63xxxxx39";
    $config["secret"] = "dexxxx3bf";
    $this->load->library('facebook',$config);

    $this->user = $user = $this->facebook->getUser();
    if ($user) {

        try {
                // Proceed knowing you have a logged in user who's authenticated.
                $user_profile = $this->facebook->api('/me');
                //print_r($user_profile);exit;
        } catch (FacebookApiException $e) {
                echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
                $user = null;
        }
        $logout = $this->facebook->getLogoutUrl();
        $this->fb_logout = $logout;
        $this->fb_user = $user_profile;

    } else {
        $login = $this->facebook->getLoginUrl(array("scope"=>"email","redirect_uri"=>"http://domain/login/login_fbmember/"));
        $this->fb_login = $login;
    }

}

This issue is really weird.这个问题真的很奇怪。 I have discovered that the problem was the static $CURL_OPTS array in the base_facebook.php.我发现问题是 base_facebook.php 中的 static $CURL_OPTS 数组。

Try to edit it from this:尝试从这里编辑它:

  /**
   * Default options for curl.
   *
   * @var array
   */
  public static $CURL_OPTS = array(
    CURLOPT_CONNECTTIMEOUT => 10,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 60,
    CURLOPT_USERAGENT      => 'facebook-php-3.2',
  );

to

  /**
   * Default options for curl.
   *
   * @var array
   */
  public static $CURL_OPTS = array(
    CURLOPT_CONNECTTIMEOUT => 10,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT        => 60,
    CURLOPT_USERAGENT      => 'facebook-php-3.2',
    CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4 
  );

The answer to my specific issue was that there were incompatibilities between the versions of the JS SDK and PHP SDK I was using and just upgrading them solved it.我的具体问题的答案是我正在使用的 JS SDK 和 PHP SDK 的版本之间存在不兼容性,只需升级它们即可解决。

The symptom of this issue is similar when it's caused by a variety of different things so you may do very well in scouting through the different answers available in this page.当它由各种不同的事情引起时,此问题的症状是相似的,因此您可能会很好地通过此页面中提供的不同答案进行侦察。

If you use the new SDK 3.1.1 and JS you need to add new variable to FB.init routine called如果您使用新的 SDK 3.1.1 和 JS,您需要将新变量添加到名为 FB.init 的例程中

oauth: true to use the new OATH 2.0 Protocol ! oauth: true使用新的 OATH 2.0 协议! Then update your login button while perms are not allowed please use scope instead of perms然后在不允许烫发时更新您的登录按钮,请使用 scope 而不是烫发

getUser() and PHP-SDK silently fails if _REQUEST like globals dropping by http server by misconfiguration.如果_REQUEST之类的全局变量因配置错误而被 http 服务器丢弃,则getUser()和 PHP-SDK 会静默失败。 I was using wrong-configured nginx and after tracing code ~3 hours solved this problem via vhost configuration change.我使用了错误配置的 nginx 并在跟踪代码约 3 小时后通过 vhost 配置更改解决了这个问题。

I wrote a comment about solution here: https://github.com/facebook/php-sdk/issues/418#issuecomment-2193699我在这里写了关于解决方案的评论: https://github.com/facebook/php-sdk/issues/418#issuecomment-2193699

I hope helps.我希望有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM