fsockopen通讯https问题
<?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的通讯问题。 Unable to find the socket transport "http" - did you forget to enable it when you configured PHP? (42852192)
似乎用http也会有这个毛病 很明显你这fscokopen参数有问题,人家也已经提示你了Unable to find the socket transport "https",socket transport要用ssl,详细自己去看官网文档吧
http://php.net/manual/zh/function.fsockopen.php
http://php.net/manual/zh/transports.inet.php
页:
[1]