【发布时间】:2014-07-18 15:10:25
【问题描述】:
我开始使用 facebook API。 我从 facebook 下载了示例代码,配置了我的 appID 和密钥。
<?php
require '../src/facebook.php';
// Create our Application instance (replace this with your appId and secret).
$facebook = new Facebook(array(
'appId' => '...',
'secret' => '....',
));
// Get User ID
$user = $facebook->getUser();
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');
?>
在本地主机上,脚本可以正常工作。但是在主机上我收到以下错误:
使用捆绑信息发现无效或未找到证书颁发机构
.crt 文件已成功上传
有人可以指出我的错误吗? 提前致谢。
【问题讨论】:
-
对不起,我过早地标记了下面的答案。我认为我能够清理这两个答案,并使访问者清楚接受答案的后果。由于我的努力,我也获得了一个不错的 Link to the Past 帽子!