学习php需要了解的点4 - PHP中file_get_contents函数抓取https地址出错的解决方法

在php中,利用file_get_contents函数抓取url是https开头的网站网页内容时,会出现类似下面的错误警告:

Warning: file_get_contents(https://127.0.0.1/index.php) [function.file-get-contents]: failed to open stream: Invalid argument in E:\website\blog\test.php on line 25

打开php.ini找到 ;extension=php_openssl.dll ,去掉双引号”;” ,重启web服务器即可。

猜你喜欢

转载自blog.csdn.net/lwcbest/article/details/38088265
今日推荐