【发布时间】:2014-05-26 20:11:50
【问题描述】:
我正在尝试使用特定查询信息 ping 域。
这应该非常简单,但它不起作用。
那么...为什么这么简单的 fsockopen php 命令不起作用?!
fsockopen('http://www.domain.com/test?q=https://example.com', 80);
警告:fsockopen() [function.fsockopen]: 无法连接到http://www.domain.com/test?q=https://example.com:80(无法找到套接字传输“http” - 您在配置 PHP 时是否忘记启用它?)在 ...
【问题讨论】:
-
你为什么要为 http 使用套接字?如果您只需要远程 http 功能(具有用于更改标头和内容的大量功能),请尝试使用 php cURL。 (php.net/manual/en/book.curl.php)
-
是的!我已将其更改为 cUrl。完美运行!谢谢:)