1

I'm configuring a new Web development machine using the very complete and well-written guide published by Echo Software but I cannot connect to localhost after following/checking every step. My only changes were using PHPv7.0 instead of 5.6, and disabling MySQL strict mode because some third-party software I need to run requires looser rules.

I can ping 127.0.0.1, localhost and *.dev domains successfully (all three commands return the exact same output):

$ ping -c1 127.0.0.1 
$ ping -c1 localhost
$ ping -c1 test.dev
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.092 ms

--- 127.0.0.1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss

However I still cannot connect to any of those over HTTP (same results when using Safari Chrome or Firefox):

$ curl http://localhost
curl: (7) Failed to connect to localhost port 80: Connection refused

I have asserted that Apache, PHP, and dnsMasq are all running by running brew services list, and that all are properly configured:

$ brew services list
Name    Status              Plist
dnsmasq started /Users/{mysusername}/Library/LaunchAgents/homebrew.mxcl.dnsmasq.plist
httpd22 started /Users/{mysusername}/Library/LaunchAgents/homebrew.mxcl.httpd22.plist
mysql   started /Users/{mysusername}/Library/LaunchAgents/homebrew.mxcl.mysql.plist
php70   started /Users/{mysusername}/Library/LaunchAgents/homebrew.mxcl.php70.plist
$ apachectl -v
Server version: Apache/2.2.31 (Unix)
$ apachectl -t
Syntax OK    
$ php -v
PHP 7.0.10 (cli) (built: Aug 21 2016 19:14:33) ( NTS )

I don't see port 8080 listed when I run a port scan on 127.0.0.1, but as I understand it is autoforwarded by pf.

I have already:

  • Checked my /etc/hosts file: it has not been tampered with.
  • Disabled my firewall: no change whatsoever.
  • Double-checked every step from the guide.
  • Followed the same guide twice just months ago: both machines are now happy.
  • Read every similar question/answer I could find, but none helped.
  • Looked for output in the Apache and PHP log files: nothing there either.
  • Run out of hypothesis...

Any help would be greatly welcome!


Edit: I also have rbenv and docker/docker-compose setup on the machine, I hope that it's not conflicting because I need them both as well.

  • Can you curl or telnet to port 8080 ? – user151019 Sep 12 '16 at 14:26
  • @Mark: No, I cannot either. $ curl localhost:8080 curl: (7) Failed to connect to localhost port 8080: Connection refused – Goulven Sep 12 '16 at 14:41

You must log in to answer this question.

Browse other questions tagged .