12.

php_network_getaddresses: getaddrinfo failed: Name or

編集
この記事の要点
  • PHP の php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 原因: DNS 解決の失敗file_get_contents / curl 等で外部接続時)
  • 恒久対処: /etc/resolv.conf(CentOS)に DNS サーバを設定
  • 不定期発生ならサーバ再起動で改善することも

 

エラー内容

php_network_getaddresses: getaddrinfo failed: Name or service not known

 

発生条件/原因/対処法

file_get_contents実行時等に発生するエラー。

本来なら適当なDSNサーバーを/etc/resolv.conf(CentOSの場合)に設定すれば解決する問題ではあるが、問題は不定期に起こる場合。(成功したり成功しなかったり)

一度サーバーを再起動すると直ることがあるので、再起動してみること。

 

編集
Post Share
子ページ

子ページはありません

同階層のページ
  1. Fatal error: Maximum execution time of 30 seconds exceeded in...
  2. Fatal error: Uncaught Error: Cannot use object of type stdClass as array in ...
  3. Warning: Use of undefined constant ... - assumed '...' (this will throw an Error)
  4. ERROR: Call to undefined method Maatwebsite\Excel\Excel::load()
  5. Maximum execution time of 30 seconds exceeded
  6. Your requirements could not be resolved to an installable set of packages. ... To enable extensions, verify that they are enabled in your .ini files:
  7. could not find driver
  8. the requested PHP extension mbstring is missing from your system.
  9. the requested PHP extension dom is missing from your system.
  10. A non well formed numeric value encountered
  11. Warning: Cannot modify header information - headers already sent by ...
  12. php_network_getaddresses: getaddrinfo failed: Name or service not known
  13. XMLWriter::openUri(): Unable to resolve file path
  14. Object of class stdClass could not be converted to string
  15. Class 'Google_Service_Youtube' not found