问题描述
我已经在本地主机上测试了登录脚本,没有问题。
I have tested my login script on my localhost with no problems.
我现在已经在线上传了该脚本,如在
I have now uploaded it online as can be seen at this link
显然,如果单击,您会看到一个空白
Obviously if you click, you can see that a blank page is displayed and I have no idea why.
我对一点内容进行了测试,并删除了Facebook SDK代码。
I did a test of a little bit of content, and removed the Facebook SDK code.
//Facebook config (required for library)
$fb_config = array(
'appId' => 'REMOVED',
'secret' => 'REMOVED'
);
//Load Facebook library
$this->load->library('facebook', $fb_config);
//SET FACEBOOK USER
$fbuser = array();
$fbuser = $this->facebook->getUser();
不存在上述代码时,页面就会加载。
When the above code is not present, the page loads.
我已经正确更新了我的应用程序设置,即将网站URL从 http:// localhost
更改为,所以我不相信是这样。
I have updated my app setting correctly, namely changing the site URL fro http://localhost
to http://gua.com so i dont believe it is that.
我甚至将配置项设置更改为显示所有错误-未显示任何内容。
I have even changed my CI settings to show all errors - nothing is shown.
对于上面的代码为何仅在在线托管时才加载空白页的人没有任何建议吗?
Does anyone have any suggestions as to why the above code might be making a blank page load ONLY when it is hosted online?
非常感谢
THomas
Many ThanksTHomas
推荐答案
打开base_facebook。 php并尝试从顶部删除这两行中的任何一条。
Open up the base_facebook.php and try removing either of these two lines from the top.
if (!function_exists('curl_init')) {
throw new Exception('Facebook needs the CURL PHP extension.');
}
if (!function_exists('json_decode')) {
throw new Exception('Facebook needs the JSON PHP extension.');
}
如果您停止显示白屏,则应表明您的服务器需要
If you stop getting the white screen, it should indicate that your sever needs either curl or json_decode enabled.
或者,您可以执行 echo phpinfo()
并检查是否已启用它们。注意json_decode / encode仅在php> = 5.2
Alternatively you could just do a echo phpinfo()
and check if they are enabled. Note that json_decode/encode is only available in php >=5.2
这篇关于Facebook SDK打破了Codeigniter?空白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!