Php 运行Facebook应用程序时出错
我正在facebook中创建一个测试应用程序,因此我尝试访问用户信息,因此在创建$facebook->getSession()时提示用户接受窗口,它显示以下错误:Php 运行Facebook应用程序时出错,php,facebook,Php,Facebook,我正在facebook中创建一个测试应用程序,因此我尝试访问用户信息,因此在创建$facebook->getSession()时提示用户接受窗口,它显示以下错误: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /nfs/c05/h01/mnt/78225/domains/apps.royal
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /nfs/c05/h01/mnt/78225/domains/apps.royalworkshop.com/html/fb/index.php:2) in /nfs/c05/h01/mnt/78225/domains/apps.royalworkshop.com/html/fb/src/facebook.php on line 37
Fatal error: Call to undefined method Facebook::getSession() in /nfs/c05/h01/mnt/78225/domains/apps.royalworkshop.com/html/fb/index.php on line 14
有人知道如何解决这个问题,我不是一个服务器或更少的专家。。。谢谢 更改为$facebook->getUser();相反这就是PHPSDK3.1.1中使用的内容。最近的版本。您可能需要更新。
@MarcB这里有两个部分,其中一个绝对不是这个问题的重复。
$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;
}
}