解决PHP Warning: file_get_contents failed to open stream: no suitable wrapper could be found.

解决PHP Warning: file_get_contents failed to open stream: no suitable wrapper could be found.

post by rocdk890 / 2013-5-14 13:39 Tuesday linux技术

发表评论

  今天给blog添加gravatar头像缓存功能,php报下面的错误:
PHP Warning: file_get_contents failed to open stream: no suitable wrapper could be found.
网上搜了下,找到了解决办法,现放出来给大家看看.
  系统:centos 5.5
在错误日志中,php报的错误是

1PHP Warning: file_get_contents(url=domainname]Portal Home - DomainName, Inc.) [<a href='function.file-get-contents'>function.file-get-contents</a>]:
2failed to open stream: no suitable wrapper could be found in/home/cpanelusername/public_html/test.php on line.


此警告说服务器阻止访问远程文件,修改php.ini

allow_url_fopen = Off
allow_url_include = Off
改成
allow_url_fopen = On
allow_url_include = On
重启php-fpm或者重启web服务.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值