Maison  >  Questions et réponses  >  le corps du texte

linux - centos执行curl命令无结果?

centos7服务器执行curl命令,一直是下面的状态,是哪里配置有问题吗?

PHP中文网PHP中文网2744 Il y a quelques jours1326

répondre à tous(2)je répondrai

  • PHP中文网

    PHP中文网2017-04-17 17:06:13

    亲,先试试ping www.baidu.com,看是否能解析到百度地址呢?我估计你是不是没有配置DNS地址

    répondre
    0
  • PHPz

    PHPz2017-04-17 17:06:13

    先ping www.baidu.com
    看网络是否正常,能ping通的话,建议你就检查一下有没有设置代理,ping是不走代理的。 echo $http_proxy 看下输出,有输出的话证明配置了代理。
    输入ifconfig
    看一下ip设置是否正确
    接着你可能需要配置dns和网关
    这是配置命令:

    比如修改网卡eth0的IP为 192.168.1.111
    ifconfig eth0 192.168.1.111 netmask 255.255.255.0
    修改网关为192.168.1.1
    route add default gw 192.168.1.1
    Linux命令行修改dns
    echo "nameserver 114.114.114.114">> /etc/resolv.conf
    重启网络服务
    /etc/rc.d/init.d/network restrart

    répondre
    0
  • Annulerrépondre