【发布时间】:2017-03-15 16:19:06
【问题描述】:
我在使用 php 从 Facebook sdk 获取电子邮件地址时遇到问题。
错误信息:
注意:未定义的变量:请求在 /storage/h5/727/1013727/public_html/index.php 在第 94 行
致命错误:未捕获的错误:调用成员函数 execute() on /storage/h5/727/1013727/public_html/index.php:94 中的 null 堆栈跟踪:
0 {main} 在 /storage/h5/727/1013727/public_html/index.php 中抛出 第 94 行
我的代码是:
<?php
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
$session,
'GET',
'/{email}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
?>
我唯一需要的是:
require_once __DIR__ . '/facebook-sdk-v5/autoload.php';
我应该制作一个加载所有内容的 config.php 吗?如果是这样,你知道 git 上有什么东西,因为我找不到 (V5)
【问题讨论】:
-
用file_exists函数检查文件是否存在
标签: php html facebook-graph-api facebook-php-sdk