【解决】PHP:file_get_contents(): Unable to find the wrapper https
作者:admin 时间:2026-4-22 11:41:3 浏览:今天使用PHP函数file_get_contents()抓取某网页,抓取HTTP网页没问题,但抓取HTTPS网页时就报错:
Warning: file_get_contents() [function.file-get-contents]: Unable to find the wrapper "https" - did you forget to enable it when you configured PHP?
中文意思是 file_get_contents() 不能找到包装器 https ,是否配置PHP时没有允许?
如此说来,应该时PHP配置问题,而PHP的配置文件是php.ini。
经查询,说是要允许ssl,只需修改 php.ini 的一个地方。
于是来到php的安装目录,打开 php.ini,把下面语句前面的分号“;”去掉即可。
;extension=php_openssl.dll

最后,不要忘了重启Web服务器。
这样,问题就解决了。
相关文章
本站声明:本站为非经营性网站,文章内容来源或整理于网络,本站不提供软件下载服务,侵删联系:webkaka#foxmail.com
相关文章
x



