使用PHP中的库函数file_get_contents时出现Unable to find the wrapper "https"错误解决
2017-03-09 14:55
856 查看
一、错误描述
上面这幅图是出现错误时的情景,出现这个错误的原因很简单,因为你php配置出了问题,本人使用的是自己搭建的wamp环境(apache, mysql, php)。先说一下为什么会出现这个问题,原因是你的URL地址的前缀是https;在URL前加https前缀表明是用SSL加密的。 你的电脑与服务器之间收发的信息传输将更加安全。Web服务器启用SSL需要获得一个服务器证书并将该证书与要使用SSL的服务器绑定。http和https使用的是完全不同的连接方式,用的端口也不一样,前者是80,后者是443。http的连接很简单,是无状态的。HTTPS协议是由SSL+HTTP协议构建的可进行加密传输、身份认证的网络协议要比http协议安全。读完这段话你也应该知道原因了。因为你的php配置中的加密模块并没有打开。
二、问题解决方案
打开你的php.ini配置文件,定位到下图蓝色所示的位置,把extension=php_openssl.dll前面的
;分号去掉。
openSSL是一个用C++写开源的SSL加密库,https=http+SSL,所有当你打开这个模块就可以使用在URL前缀https的请求了。去掉
;注释后,重新启动Apache服务器,再访问,就不会有这个错误了。
相关文章推荐
- PHP的readfile函数和file_get_contents函数错误: Unable to find the wrapper "https"
- file_get_contents()获取https出现这个错误Unable to find the wrapper “https”
- file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it 的解决
- file_get_contents()获取https出现这个错误Unable to find the wrapper “https” – did
- file_get_contents()获取https出现这个错误Unable to find the wrapper “https” – did
- file_get_contents()获取https出现这个错误Unable to find the wrapper “https” – did
- Message: file_get_contents(): Unable to find the wrapper "https" .....
- Unable to find the wrapper "https"错误的解决办法
- file_get_content警告Unable to find the wrapper "https"
- unable to find the wrapper "https"错误解决办法
- Unable to find the wrapper "https"错误的解决办法
- Unable to find the wrapper "https"错误的解决办法
- Unable to find the wrapper "https"错误的解决办法
- Unable to find the wrapper "https"错误的解决办法
- Unable to find the wrapper "https"错误的解决办法
- php Unable to find the wrapper "https"
- 解决Unable to find the wrapper "https"的二种方法
- Warning: readfile(): Unable to find the wrapper "https"解决办法
- PHP: Unable to find the wrapper "https"
- c++执行程序出现"unable to find a version of the runtime"的错误提示