title: Localhost not working mac terminal
body: <p>Trying to run localhost to test a website in mac osx terminal.</p>
  
  <pre><code>andys-mbp:test Andy$ cd /Users/Andy/Desktop/test 
  andys-mbp:test Andy$ php -S localhost:8000
  </code></pre>
  
  <p>This would usually work, but now I'm getting this error message:</p>
  
  <blockquote>
    <p><b>Warning</b>:  Unknown: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known in <b>Unknown</b> on line <b>0</b><br />
    [Tue Feb 24 12:55:58 2015] Failed to listen on localhost:8000 (reason: php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known)</p>
  </blockquote>
  
  <p>I've followed <a href="http://php.about.com/od/phpbasics/ss/installMac_4.htm#step-heading" rel="nofollow">this tutorial</a> to make sure PHP and apache are running, but it didn't seem to help...</p>
  
  <p>How can I fix this? Any help very much appreciated!</p>