Linux – Apache – Php – php_network_getaddresses – Name or service not known
Came across an issue where I was getting “SQLSTATE[HY000]  php_network_getaddresses: getaddrinfo failed: Name or service not known” errors when one of my applications was trying to establish a connection to a MySQL db.
In my /etc/resolv.conf file I didn’t have the domain with the host DNS information, so I added it. At this point I was able to ping the host via command line, but was still getting the errors. After some Googling I came across http://albertech.net/2011/05/fix-php_network_getaddresses-getaddrinfo-failed-name-or-service-not-known/ where the author indicated that if you can ping the host via command line but are still getting the errors, try restarting Apache. So I followed his suggestion, restarted Apache, and it worked like a charm.
- PHP – Doctrine – DQL – Select Subquery
- Symfony – Share Template Across Multiple Apps
- Linux – Using Curl to Test Response Headers
- PHP – ZipArchive – 5.3.x – Weird Issue when Unlinking a File Just Added to Archive
- PHP – Symfony – Speed up CLI Commands – Do Not Load Web Plugins
- PHP – Symfony – Build Model – No yml schema found
- CentOS – sealert – Convert audit messages into human readable (and understandable) format
- PHPUnit – You must not expect the generic exception class
- PHP – Correctly Cast Numeric Strings to Numeric Datatypes
- PHP – Reflection Class – Determine Parent Method Signature