douban2014
2014-04-17 09:30 阅读 53
已采纳

Yii错误500:php_network_getaddresses:getaddrinfo失败:名称或服务未知

yesterday some pages have returned this error: Error 500: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known I tried to search this problem in relation with Yii framework but I did not found no solutions to this issue.

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    duanhua9398 duanhua9398 2014-04-17 09:44

    try checking the URLs like this :

    $ch = curl_init($url); //<=== YOUR URL
    
    curl_setopt($ch, CURLOPT_NOBODY, true);
    curl_exec($ch);
    $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    // if $retcode >= 400 -> not found else if $retcode = 200, found.
    curl_close($ch);
    
    点赞 评论 复制链接分享

相关推荐