Bug #11058 [Com]: php_network_getaddresses: getaddrinfo failed
[email protected] ("chilieu dot me at gmail dot com")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at https://bugs.php.net/bug.php?id=11058&edit=1
ID: 11058
Comment by: chilieu dot me at gmail dot com
Reported by: pat at mail dot rit dot edu
Summary: php_network_getaddresses: getaddrinfo failed
Status: Not a bug
Type: Bug
Package: Network related
Operating System: OpenBSD 2.6
PHP Version: 4.0.6
Block user comment: N
Private report: N
New Comment:
This happened to our server again in 24hrs
Our is running Ubuntu 16.04 LTS, nginx, PHP-FPM, PHP 7.0.15-1+deb.sury.org~trusty+1
when I was trying to use file_get_contents to get estimation shipping fee from ups
the only way I can fix it is restart php
Previous Comments:
------------------------------------------------------------------------
[2017-03-23 08:56:21] spam2 at rhsoft dot net
did you guys who are affected install updates on your machines which replaced from webserver/php loaded libraries without re-starting the webserver? updating "nss" without hard restart httpd was the only time in the past decade where is saw similar issues - hence don't appyl autoupdates blindly and restart services with orphaned filehandles - especially services which are forking or have multiple threads
------------------------------------------------------------------------
[2017-03-23 08:48:36] kostello at gmail dot com
I have just encountered this issue twice on two separate virtual machines over the past 24 hours! These VMs are stable, the uptime was about one week for the first, about twelve hours for the second, when the errors occurred. They both run Ubuntu 14.04 LTS, nginx 1.8, PHP-FPM. More specifically, the first VM runs PHP 7.0.15-1+deb.sury.org~trusty+1, and the second one runs PHP 5.5.9-1ubuntu4.21. Here is the error message I get with file_get_contents($url)
>> Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /script.php on line 276
>> Warning: file_get_contents(http://www.******.com/history.php): failed to open stream: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /script.php on line 276)
NB: using CURL did not work either but did not return any data nor did it trigger any error message. However I assume that it is for the same reason.
Both times, I inspected the configuration: DNS resolvers, permissions on /etc/hosts, on /etc/resolv.conf, and other things, all good. Furthermore, no DNS issues to report when using "wget" or "svn update" or any other network tool - it was really just PHP. To rule out a possible error in my own PHP scripts, I created a simple "test.php" file with one line: file_get_contents('http://www.google.com') and the error still occurred.
The only way I could got rid of the problem in both cases was doing a "service php-fpm restart". As the issue was critical, I had to quickly proceed with the restart and I didn't have time to investigate further. How can I make sure this doesn't happen again?
------------------------------------------------------------------------
[2015-09-30 15:24:30] piet at ibuildings dot nl
Today I had a problem resolving google.com, I got the following error msg:
php_network_getaddresses: getaddrinfo failed: No address associated with hostname
Using the default Fedora 22 packages:
Apache/2.4.16 (Fedora)
PHP 5.6.13 (cli) (built: Sep 3 2015 12:18:26)
When I started my pc in de morning I had no issues resolving a hostname. Somewhere during the day it went wrong. Restarting Apache solved the problem.
How can be addressed as 'Not a bug'!? It took 1 hour of my time figuring out that a basic PHP function was failing me.
------------------------------------------------------------------------
[2014-12-17 10:07:11] rakeshpatil919 at gmail dot com
i m tryng to get image type by using getimagesize() function from remote network sometimes its working perfect but sometimes its showing
A PHP Error was encountered
Severity: Warning
Message: getimagesize(): php_network_getaddresses: getaddrinfo failed: Name or service not known
------------------------------------------------------------------------
[2014-07-16 22:45:15] tino dot spirit at gmail dot com
This is not a PHP Bug !
It's a server misconfiguration
Check out my thread at :
http://serverfault.com/questions/612992/nginx-and-php-cant-resolve-hostname-and-make-connection-with-fqdn
I've shared some of my gathered solutions there.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=11058
--
Edit this bug report at https://bugs.php.net/bug.php?id=11058&edit=1