title: After enabling PDO - Error 2002 getaddrinfo failed: Name or service not known
body: <p>I recently learned about PDO so I changed my php files to fit the format and now I am getting back this response:</p>
  
  <p><code>ERROR: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known</code></p>
  
  <p>I did not change the connection variables just the format to fit PDO. I am running a Bitnami Lampstack (5.3.16-0) and did what the documentation said as far as uncommenting the line for PDO with mysql in the php.ini file. I am wondering if it has to do with my mysql.sock file which has a size of 0.</p>
  
  <p>My PDO connection looks like this (I added the unix_socket and port pieces because they were mentioned in another question relating to this error but they didn't seem to help):</p>
  
  <p><code>$dbConnection = new PDO('mysql:unix_socket=/opt/lampstack-5.3.16-0/mysql/tmp/mysql.sock;host=$dbhost;port=3306;dbname=$dbname;', $user, $pass);</code></p>
  
  <p>apache, mysql, httpd, ect are all running fine on my server and this only came up after enabling PDO.</p>