file_get_contents()获取https出现这个错误Unable to find the wrapper “https” – did
来源:互联网 发布:纯软件语音室 编辑:程序博客网 时间:2024/06/05 15:37
file_get_contents()获取https出现这个错误Unable to find the wrapper “https” – did
解决办法一,如果你是用的服务器,可以参考这个办法,修改php配置文件(win主机),来支持https
在php.ini中找到并修改
extension=php_openssl.dll allow_url_include = On
重启服务就可以了,如果你的是linux服务器,linux下的PHP,就必须安装openssl模块,安装好了以后就可以访了。
解决办法二,如果你用的不是服务器,你用的主机,你没法更改php的配置,你可以通过使用curl函数来替代file_get_contents函数,当然你的主机必须支持curl函数。
[down]
<?php
function getSslPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
echo getSslPage($_GET['url']);
?>[/down]
- file_get_contents()获取https出现这个错误Unable to find the wrapper “https” – did
- file_get_contents()获取https出现这个错误Unable to find the wrapper “https”
- 使用PHP中的库函数file_get_contents时出现Unable to find the wrapper "https"错误解决
- file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it 的解决
- Message: file_get_contents(): Unable to find the wrapper "https" .....
- PHP的readfile函数和file_get_contents函数错误: 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"
- Warning: fopen() [function.fopen]: Unable to find the wrapper “https” – did you forget to enable it
- Warning: readfile(): Unable to find the wrapper "https"解决办法
- file_get_content警告Unable to find the wrapper "https"
- 解决Unable to find the wrapper "https"的二种方法
- 解决git的这个错误:fatal: Unable to find remote helper for 'https'
- 解决git的这个错误:fatal: Unable to find remote helper for 'https'
- Git出现fatal: Unable to find remote helper for 'https'
- java DOS编译相关
- c++中一个关于模板的小例子
- codevs代码分类总结
- 第12 课:HA下的Spark集群工作原理解密
- C++中构造函数能调用虚函数吗?(转)
- file_get_contents()获取https出现这个错误Unable to find the wrapper “https” – did
- static静态
- java Map实现的cache manager,定时清除缓存起来的值
- Android性能优化——渲染、内存、电源优化
- Centos6.5上搭建LAMP并使用navicat工具连接数据库
- Djando安装配置
- Python Exception 错误信息输出机理
- 随便写写的java笔记10
- samba不允许一个用户使用一个以上用户名与一个服务器或共享资源的多重连接