- 积分
- 2
- 威望
-
- 金钱
-
- 注册时间
- 2016-6-6
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
<?php
$fp = fsockopen("https://xxxx", 443, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)
\n";
} else {
$out = "GET / HTTP/1.1\r\n";
$out .= "Host: xxx\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>
使用fsockopen去通讯https网站的时候发现如果这么写会导致php报错Unable to find the socket transport "https" - did you forget to enable it when you configured PHP? (42852192),去网上找了下没有合适的修复方案(大多数是Windows),然而本机是腾讯云Centos6.5 64x有什么办法能解决这个问题么?重新编译PHP也可以,但是不会写参数。。
军哥可否给出一点建议指导?
PS:解决这个是为了解决DZ的通讯问题。 |
|