用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3828|回复: 2
收起左侧

[HELP] 使用file_get_contents或fopen调用url文件空白是什么问题?

[复制链接]
发表于 2011-8-23 13:56:18 | 显示全部楼层 |阅读模式
PHP复制代码
 
$feicuixml = file_get_contents ( "http://www.jadewd.com/forum-rss-fid-4-auth-0.html", "r" )or exit("Unable to open file!");
$feicuixml = file_get_contents ( "test.xml", "r" );
print_r( $feicuixml);
 
复制代码

上面代码放在本地都可以执行,但是在服务器上却无法执行第一行代码,也无报错,返回Unable to open file!
服务器禁用了
phpinfo,passthru,exec,shell_exec,system,popen,proc_open,pcntl_exec,escapeshellcmd,proc_get_status,proc_nice,proc_terminate
这些函数我也在本地禁用后发现都是可以调取url的
服务器的allow_url_fopen也是on的
Array(    [allow_url_fopen] => Array        (            [global_value] => 1            [local_value] => 1            [access] => 4        ))
转用curl来代替file_get_contents依然无效,请问这是服务器上什么问题呢?
 楼主| 发表于 2011-8-24 15:39:47 | 显示全部楼层
求指教啊
发表于 2011-9-28 13:13:49 | 显示全部楼层
我也碰到过同样的问题,有可能是链接建立的响应时间不够长,你可以把响应时间加长点看看。

本版积分规则