jquery教程

推荐列表 站点导航

当前位置:首页 > jquery > jquery教程 >

PHP Warning: file_get_contents failed to open stream解决办法

来源:网络整理  作者:  发布时间:2020-12-20 21:03
jquery中文网为您提供PHP Warning: file,get,contents failed to open stream解决办法等资源,欢迎您收藏本站,我们将为您提供最...

今天百度了一下!找到了解决办法!先拷贝过来!

linux下处理方法:

Warning: file_get_contents() [function.file-get-contents]: wrapper is disabled in the server configuration by allow_url_fopen=0

extension=php_openssl.dll 把前的;去掉,重启apache服务。

allow_url_include = On

/etc/php.ini


allow_url_include = Off

extension=php_openssl.dll 把前的;去掉,重启iis服务。

在做项目时用 file_get_contents 来获取数据,php 报错  PHP Warning: file_get_contents failed to open stream: no suitable wrapper could be found.

c:\windows\php.ini

file_get_contents函数在获得远程文件时提示Warning: file_get_contents failed to open stream,希望例子能够帮助到各位,希望例子能够帮助到大家。

$context = stream_context_create(array('http'=>array('ignore_errors'=>true)));

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

如果还是无法解决 的话

$contents = file_get_contents($url, FALSE, $context);

如果上面问题没能解决我的问题,我们可以如下测试。

在错误日志中,php报的错误是


failed to open stream: no suitable wrapper could be found

allow_url_fopen = On

最后用了curl来获取数据!

allow_url_fopen = Off

重启php-fpm或者重启web服务。

系统:centos 6.5

windows下处理方法:

改成

可以请求时,忽略错误。可以解决警告信息

相关热词: php 解决

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jq/jc/6341.shtml

最新文章
PHP识别相片是否是颠倒的 PHP识别相片是否是颠倒的

时间:2020-12-28

python编程有哪些ide python编程有哪些ide

时间:2020-12-28

python开发工程师是做什么 python开发工程师是做什么

时间:2020-12-28

php构造函数的作用 php构造函数的作用

时间:2020-12-28

php怎么跟数据库连接 php怎么跟数据库连接

时间:2020-12-28

php实现顺序线性表 php实现顺序线性表

时间:2020-12-28

Python多重继承中的菱形继 Python多重继承中的菱形继

时间:2020-12-28

php中break的作用 php中break的作用

时间:2020-12-28

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

PHP Warning: file_get_contents failed to open stream解决办法

2020-12-20 编辑:

今天百度了一下!找到了解决办法!先拷贝过来!

linux下处理方法:

Warning: file_get_contents() [function.file-get-contents]: wrapper is disabled in the server configuration by allow_url_fopen=0

extension=php_openssl.dll 把前的;去掉,重启apache服务。

allow_url_include = On

/etc/php.ini


allow_url_include = Off

extension=php_openssl.dll 把前的;去掉,重启iis服务。

在做项目时用 file_get_contents 来获取数据,php 报错  PHP Warning: file_get_contents failed to open stream: no suitable wrapper could be found.

c:\windows\php.ini

file_get_contents函数在获得远程文件时提示Warning: file_get_contents failed to open stream,希望例子能够帮助到各位,希望例子能够帮助到大家。

$context = stream_context_create(array('http'=>array('ignore_errors'=>true)));

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

如果还是无法解决 的话

$contents = file_get_contents($url, FALSE, $context);

如果上面问题没能解决我的问题,我们可以如下测试。

在错误日志中,php报的错误是


failed to open stream: no suitable wrapper could be found

allow_url_fopen = On

最后用了curl来获取数据!

allow_url_fopen = Off

重启php-fpm或者重启web服务。

系统:centos 6.5

windows下处理方法:

改成

可以请求时,忽略错误。可以解决警告信息

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jq/jc/6341.shtml

相关文章

风云图片

推荐阅读

返回jquery教程频道首页