解决PHP Warning: file_get_contents failed to open stream: no suitable wrapper could be found.
今天给blog添加gravatar头像缓存功能,php报下面的错误:
PHP Warning: file_get_contents failed to open stream: no suitable wrapper could be found.
网上搜了下,找到了解决办法,现放出来给大家看看.
系统:centos 5.5
在错误日志中,php报的错误是
此警告说服务器阻止访问远程文件,修改php.ini
把
allow_url_fopen = Off
allow_url_include = Off
改成
allow_url_fopen = On
allow_url_include = On
重启php-fpm或者重启web服务.