今天在阿里云上部署一个比较老的程序,用的是阿里云的esc,环境如下:
php version 5.2.17
apache/2.2.29 (unix)
mysql 5.1.73
index.php文件中有如下代码
$ch = curl_init();curl_setopt($ch,curlopt_url,'http://www.baidu.com/');curl_setopt($ch, curlopt_customrequest, get);//curl_setopt($ch, curlopt_ssl_verifypeer, false);//curl_setopt($ch, curlopt_ssl_verifyhost, false);curl_setopt($ch, curlopt_returntransfer, true);$info = curl_exec($ch);curl_close($ch);echo $info;
当我访问 域名/index.php 的时候正常出现了百度的页面。
但是我修改一下之后直接出现连接被重置,网上搜了一下没找到有效的解决方法。
$ch = curl_init();curl_setopt($ch,curlopt_url,'https://www.baidu.com/');curl_setopt($ch, curlopt_customrequest, get);curl_setopt($ch, curlopt_ssl_verifypeer, false);curl_setopt($ch, curlopt_ssl_verifyhost, false);curl_setopt($ch, curlopt_returntransfer, true);$info = curl_exec($ch);curl_close($ch);echo $info;
是什么原因导致这个问题呢?是php版本问题还是其他什么原因?求解,不甚感激!
回复内容: 今天在阿里云上部署一个比较老的程序,用的是阿里云的esc,环境如下:
php version 5.2.17
apache/2.2.29 (unix)
mysql 5.1.73
index.php文件中有如下代码
$ch = curl_init();curl_setopt($ch,curlopt_url,'http://www.baidu.com/');curl_setopt($ch, curlopt_customrequest, get);//curl_setopt($ch, curlopt_ssl_verifypeer, false);//curl_setopt($ch, curlopt_ssl_verifyhost, false);curl_setopt($ch, curlopt_returntransfer, true);$info = curl_exec($ch);curl_close($ch);echo $info;
当我访问 域名/index.php 的时候正常出现了百度的页面。
但是我修改一下之后直接出现连接被重置,网上搜了一下没找到有效的解决方法。
$ch = curl_init();curl_setopt($ch,curlopt_url,'https://www.baidu.com/');curl_setopt($ch, curlopt_customrequest, get);curl_setopt($ch, curlopt_ssl_verifypeer, false);curl_setopt($ch, curlopt_ssl_verifyhost, false);curl_setopt($ch, curlopt_returntransfer, true);$info = curl_exec($ch);curl_close($ch);echo $info;
是什么原因导致这个问题呢?是php版本问题还是其他什么原因?求解,不甚感激!
啥年代了,还用5.2 。。。。。。。。