title: php failed to connect to mongodb socket
body: <p>just set up a fresh development ubuntu 13.04 server with nginx, php-fpm, and mongodb. The following line of code kills all of my scripts that were running great on a production ubuntu 12.10 server</p>
  <pre><code>$m = new MongoClient(&quot;mongodb://user:pass@/tmp/mongodb-27017.sock/database&quot;);
  </code></pre>
  <p>error</p>
  <blockquote>
  <p><b>Warning</b>:  MongoClient::__construct(): php_network_getaddresses:
  getaddrinfo failed: Name or service not known in
  <b>/var/www/app/php/db.php</b> on line <b>4</b><br /> <br />
  <b>Fatal error</b>:  Uncaught exception 'MongoConnectionException'
  with message 'Failed to connect to: /tmp/mongodb-27017.sock:0:
  php_network_getaddresses: getaddrinfo failed: Name or service not
  known' in /var/www/app/php/db.php:4 Stack trace:</p>
  <h1>0 /var/www/app/php/db.php(4): MongoClient-&gt;__construct('mongodb://app...')</h1>
  <h1>1 /var/www/app/admin/loggedin.php(3): require('/var/www/app...')</h1>
  <h1>2 /var/www/app/admin/index.php(1): require('/var/www/app...')</h1>
  <h1>3 {main}   thrown in <b>/var/www/app/php/db.php</b> on line <b>4</b><br /></h1>
  </blockquote>
  <p>I've been toying with this for a day and half and can't figure it out. It works when I connect to localhost but I'd really prefer sockets. any ideas?</p>