Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Facebook开放图形不返回字段_Php_Facebook Graph Api_Facebook Php Sdk - Fatal编程技术网

Php Facebook开放图形不返回字段

Php Facebook开放图形不返回字段,php,facebook-graph-api,facebook-php-sdk,Php,Facebook Graph Api,Facebook Php Sdk,我同时使用PHPSDK和Javascript SDK在我的站点上登录(这很好) 我的应用程序仅授权获取基本信息,以及您在此屏幕中看到的电子邮件 但是,当我使用以下方式调用信息时: $user_profile = $facebook->api('/me','GET'); //$user_profile[] needs name etc to insert into DB $fname = $user_profile['first_name']; $lname

我同时使用PHPSDK和Javascript SDK在我的站点上登录(这很好)

我的应用程序仅授权获取基本信息,以及您在此屏幕中看到的电子邮件

但是,当我使用以下方式调用信息时:

    $user_profile = $facebook->api('/me','GET');
    //$user_profile[] needs name etc to insert into DB
    $fname = $user_profile['first_name'];
    $lname = $user_profile['last_name'];
    $email = $user_profile['email'];

除了电子邮件,我什么都能收到。。。。有什么想法吗?

必须更新我参数中的范围。看起来你在这两个地方都需要它

          $params = array(
            'scope' => 'read_stream, friends_likes, email',
            'redirect_uri' => 'http://www.#######.com'
          );