douban2014 2014-04-17 09:30
浏览 119
已采纳

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 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);
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 网页游戏在本地页面修改游戏结果
  • ¥30 comfyui openpose报错
  • ¥20 Wpf Datarid单元格闪烁效果的实现
  • ¥15 图像分割、图像边缘提取
  • ¥15 sqlserver执行存储过程报错
  • ¥100 nuxt、uniapp、ruoyi-vue 相关发布问题
  • ¥15 浮窗和全屏应用同时存在,全屏应用输入法无法弹出
  • ¥100 matlab2009 32位一直初始化
  • ¥15 Expected type 'str | PathLike[str]…… bytes' instead
  • ¥15 三极管电路求解,已知电阻电压和三级关放大倍数