【问题标题】:cURL couldn't connect to host, but it connects to my domain addresscURL 无法连接到主机,但它连接到我的域地址
【发布时间】:2014-09-18 07:40:04
【问题描述】:

我是 Linux 新手。我在 Linux 服务器中有 php 项目。我在我的 php 页面中使用cURL 命令访问 Google,但它说它无法访问主机。

从命令行,我可以 ping 谷歌站点,而 cURL 和 Wget 命令失败。

我检查了防火墙:selinux=disabledselinuxtype=targeted

【问题讨论】:

    标签: php linux curl wget firewall


    【解决方案1】:

    从终端试试这个命令

    telnet www.google.com 80
    

    你有任何输出吗?喜欢Connected to www.google.com?如果没有,则在端口 80 上对 google.com 的传出访问将被阻止。

    Ping 使用ICMP protocol。 cURL(和 telnet)在端口 80 或 443 上使用 TCP

    【讨论】:

      猜你喜欢
      • 2013-07-31
      • 1970-01-01
      • 1970-01-01
      • 2020-02-18
      • 2017-04-15
      • 1970-01-01
      • 2014-11-06
      • 2019-04-25
      相关资源
      最近更新 更多