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.
- virsh – Refusing to undefine while domain managed save image exists
- Git – Revert Multiple Locally Changed Files
- Linux – SELinux – SEModule – Compile .pp module from .te file
- PHP – Doctrine – Soft Delete – Multiple Rows at a Time
- 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