php file_get_contents失败[function.file-get-contents]: failed to open stream: HTTP request failed!解决
在使用file_get_contents方法来获取远程文件时会出现
[function.file-get-contents]: failed to open stream: HTTP request failed!
错误
解决方法是:修改php.ini 中的allow_url_fopen = On 这样可以解决部分人的问题,
完美的解决方案还得修改user_agent="PHP" ,将参数改为Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
user_agent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
模拟浏览器就可以了;
php file_get_contents失败[function.file-get-contents]: failed to open stream: HTTP request failed!解决的更多相关文章
- 完美解决failed to open stream: HTTP request failed!(file_get_contents引起的)
当使用php5自带的file_get_contents方法来获取远程文件的时候,有时候会出现file_get_contents(): failed to open stream: HTTP reque ...
- failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found 一.总结 一句话总结:这里出现的问题是我在博客园删除了一篇文章,时 ...
- failed to open stream: HTTP request failed! HTTP/1.1 505 HTTP Version Not Supported
PHP模拟GET请求支付宝退款链接(未用sdk 自己拼接的请求链接与参数); 起初用file_get_contents();就报错 :failed to open stream: HTTP requ ...
- file_get_contents failed to open stream: HTTP request failed(一个字符决定成败)
file_get_contents 开始成功了.后来不知怎么的就报错,调试半天没发现什么问题. 结果.里面多了一个"空格"就报错.去掉空格就好了,你们仔细找找吧.
- failed to open stream :HTTP request failed 解决方法
用curl抓取,不要用file_get_contents(); 前者比后者效率高一点
- file_get_contents HTTP request failed! Internal Server Error
使用file_get_contents报错 Severity: WarningMessage: file_get_contents(http://geetest.com:8000/select?gid ...
- 报错:OpenCV Error: Assertion failed (src.size() == dst.size() && src.type() == dst.ty pe()) in unknown function, file ..……
在用cvDilate函数的时候,老是导致程序中断,报错如下: OpenCV Error: Assertion failed (src.size() == dst.size() && s ...
- file get contents 访问不了域名原因
file get contents('域名'); 居然不好用 后来发现 etc/hosts 127.0.0.1 www.baidu.com 这样的 #127.0.0.1 www.baidu.co ...
- Warning: require(D:\wamp\www\glink-smart\bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in D:\wamp\www\glink-smart\bootstrap\autoload.php on line 1
Laravel访问出错错误信息:`Warning: require(/vendor/autoload.php): failed to open stream: No such file or dire ...
随机推荐
- FastCV安装报错---LaunchAnyWhere错误:载入Java VM时Windows出现错误:2
- Hadoop2.6 datanode配置在线更新
datanode 的配置可以在线更新了,http://blog.cloudera.com/blog/2015/05/new-in-cdh-5-4-how-swapping-of-hdfs-datano ...
- 网格弹簧质点系统模拟(Spring-Mass System by Euler Integration)
弹簧质点模型是利用牛顿运动定律来模拟物体变形的方法.如下图所示,该模型是一个由m×n个虚拟质点组成的网格,质点之间用无质量的.自然长度不为零的弹簧连接.其连接关系有以下三种: 1.连接质点[i, j] ...
- POJ3083Catch That Cow[BFS]
Catch That Cow Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 77420 Accepted: 24457 ...
- openjudge2989糖果[DP 01背包可行性]
openjudge2989糖果 总时间限制: 1000ms 内存限制: 65536kB 描述 由于在维护世界和平的事务中做出巨大贡献,Dzx被赠予糖果公司2010年5月23日当天无限量糖果免费优惠 ...
- Xcode 快捷键
1.commmand +shift +k ,隐藏模拟器键盘,用户可以在真实键盘输入到模拟屏幕上.
- centos7 安装拼音输入法(转载)
http://m.blog.csdn.net/article/details?id=52137523
- apt-get update更新源时,出现“Hash Sum mismatch”问题
当使用apt-get update更新源时,出现下面"Hash Sum mismatch"的报错,具体如下:root@localhost:~# apt-get update.... ...
- C语言:枚举类型
整数常量的符号名称... #include <stdio.h> enum _bool {false,true}; int main(){ enum colors { red, orange ...
- PAT 1017. A除以B (20)
本题要求计算A/B,其中A是不超过1000位的正整数,B是1位正整数.你需要输出商数Q和余数R,使得A = B * Q + R成立. 输入格式: 输入在1行中依次给出A和B,中间以1空格分隔. 输出格 ...