您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> PHP >> mac下php file_get_contents 输出为空

mac下php file_get_contents 输出为空

来源:网络整理     时间:2016/5/28 4:49:48     关键词:file_get_contents

关于网友提出的“mac下php file_get_contents 输出为空”问题疑问,本网通过在网上对“mac下php file_get_contents 输出为空”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题:mac下php file_get_contents 输出为空
描述:

mac下,安装nginx,fpm,file_get_content为空.

但是以cli模式运行正常,可以正常返回

var_dump(file_get_contents('http://games.kkguo.com/'));

fpm下为空.

cli模式正常.

allow_url_open On

看有没人碰到过这样的问题.


解决方案1:

我知道,我遇到过这个问题,是防火墙iptables的问题,我的跟你的一样,sckort和curl都没问题,就是这个file_get_contents不能访问外部网络造成的,我还不知道该如何设置iptables,正在找方法

解决方案2:

试下 var_dump(file_get_contents('http://www.baidu.com/'));

打开错误提示看看,

是不是安全模式什么的。

试下 var_dump($http_response_header);

解决方案3:

求高手解决.


以上介绍了“mac下php file_get_contents 输出为空”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/1355058.html

相关图片

相关文章