On some OS X systems MAMP is unable to start the httpd.
On my system after an upgrade it was because OS X was starting its own httpd daemon.
I was able to see this by trying to start MAMP’s httpd in a Terminal:
$ cd /Applications/MAMP/bin
$ sudo ./startApache.sh
(48)Address already in use: make_sock: could not bind to address [::]:80
(48)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
A call of
lsof confirmed it:
$ sudo lsof -iTCP -sTCP:LISTEN -P -n | grep :80
httpd 576 root 5u IPv6 0x9f5f81c483ca9e1f 0t0 TCP *:80 (LISTEN)
httpd 582 _www 5u IPv6 0x9f5f81c483ca9e1f 0t0 TCP *:80 (LISTEN)
The shows two httpd processes running with process ids of 576 and 582 respectively.
To prevent OS X automatically starting its own httpd server, use the following command in a Terminal:
$ sudo apachectl stop
This has the following effects
- it stops the running httpd and
- at the next restart no httpd will be started.
After the next restart you can use MAMP to start httpd and mysqld as usual.