开发者社区> 问答> 正文

php file_get_contents请求不到?报错

报错file_get_contents(http://120.26.68.76/index.php?app=member&act=login) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error

服务器是Windows的。代码中file_get_contents访问百度可以访问就是自己服务器上的不可以。

展开
收起
爱吃鱼的程序员 2020-06-12 15:28:48 834 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
    $opts=array('http'=>array('method'=>"GET",'header'=>"User-Agent:Mozilla/5.0\r\n"));$context=stream_context_create($opts);file_get_contents('http://120.26.68.76/index.php?app=member&act=login',false,$context);



    非常感谢你
    2020-06-12 15:29:04
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
PHP安全开发:从白帽角度做安全 立即下载
PHP 2017.北京 全球开发者大会——高可用的PHP 立即下载
复杂PHP系统性能瓶颈排查及优化 立即下载