【问题标题】:php fsockopen is NOT workingphp fsockopen 不工作
【发布时间】: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。完美运行!谢谢:)

标签: php xml seo sitemap


【解决方案1】:

fsockopen 只接受主机名。

【讨论】:

  • 是的! file_get_contents 超级简单,工作完美! :) 谢谢!
猜你喜欢
  • 2011-03-14
  • 2011-07-14
  • 2013-03-14
  • 1970-01-01
  • 2011-08-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多