Apache not starting in MAMP (but MySQL working) in OSX

MacosApacheMamp

Macos Problem Overview


I've had MAMP working for a few months and recently installed PostgreSQL. It recommended installing Apache as well, which I did to make sure PostgreSQL worked. I then uninstalled PostgreSQL and the apache build and tried to restart MAMP. It fired up the MySQL database (green light) but Apache didn't start. I uninstalled and reinstalled MAMP only to face the same problem.

Apache doesn't seem to be logging any errors in the MAMP folder, so without any errors to report I'm struggling with where to begin fixing it. I'm hoping its to do with the fact that I installed another version (and deleted it) that has caused the problem but I'm too inexperienced to know what I've done.

Where might I find any errors if not in the MAMP folder? Not in:

  • /Applications/MAMP/Library/logs
  • /Applications/MAMP/bin/logs

Macos Solutions


Solution 1 - Macos

Stoping the Apache solved this issue for me, using the command-line:

sudo apachectl stop

Solution 2 - Macos

For those of you upgrading to Yosemite there seems to be a bug which I don't really understand but its easily fixed as posted on their twitter account.

> Workaround for the 10.10 Preview 5 bug: Rename the file “envvars” located in '/Applications/MAMP/Library/bin' into “_envvars” (@mamp_en)

Solution 3 - Macos

I had a similar problem and could solve it by starting on the command line the apachectl included in MAMP:

$ /Applications/MAMP/Library/bin/apachectl start

which would yield

Syntax error on line 427 of /Applications/MAMP/conf/apache/httpd.conf:
Invalid command '\xef\xbf\xbc#AllowOverride', perhaps misspelled or defined by a module not included in the server configuration

This error message was nowhere else, not in any log file or system console. (Turns out I had copied a line from a documentation file which had copied some special characters that were not intended for my system - how easy to find is that!)

This is for MAMP 2.0.1, maybe it's handled better in newer versions.

Solution 4 - Macos

Change the recommended Apache Port from: port 80 to port 81.

Solution 5 - Macos

I have been going through all Stackoverflow posts, but no luck. Finally, I came across this: https://www.speakinginbytes.com/2013/02/mamp-problems/

> Sometimes Apache is set through MAMP to open a particular folder and that folder no longer exists. If you simple go to MAMP and change that > setting through the preferences button you should be able to fix it.

That did the trick for me. Hopefully it will help someone else!

Solution 6 - Macos

Maybe its because the original apache is on. Have you tried to see the status ? You can try this command to stop it "apachectl status" and then restart mamp and see if it works.

Solution 7 - Macos

I know this is old but in case someone else comes across this. I had a typo in my Virtual Host file (/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf) that was causing Apache not to start. It wasn't until I manually tried to start MAMP's version of Apache from the command line (/Applications/MAMP/bin/startApache.sh) that I saw the error and was able to fix it.

Solution 8 - Macos

Command line helps for this issue. like the below,

/Applications/MAMP/Library/bin/apachectl start

/Applications/MAMP/Library/bin/apachectl stop

Solution 9 - Macos

I had the same problem. After a lot of frustration about not having a descriptive error message, I realized I could check the "All messages" log under Applications/Tools/System messages (or some similar path, as I just translated from my language here). There I found the explanation, which in my case meant that a library link was broken (probably due to the uninstallation of postgres). I fixed this by recreating the link. In my case it meant I had to run the following command in the terminal:

sudo ln -s /usr/lib/libpq.5.3.dylib /usr/lib/libpq.5.dylib

and now it works!

Solution 10 - Macos

If it has at one point been working fine then I guess something else on your network is currently using the same port for something else.

I had this problem too: in my case I had changed the default MAMP Apache port from 8888 to 80. It worked fine until I installed a web server on another machine on my network and tweaked /etc/hosts on my local machine to include the new server. This meant that port 80 was already in use and MAMP's Apache couldn't start.

The solution was to either stop the second web server on my network, or revert MAMP back to 8888. Both approaches worked fine.

Solution 11 - Macos

In my case was a wrong ssl certificate on an vhost. To test, just temporarily deactivate ssl from all your ssl vhost and see if it starts. NOTE: even if the ssl vhost are not checked.

Solution 12 - Macos

  1. Quit MAMP

  2. Use the command-line to run:

    $ sudo apachectl restart

  3. Open MAMP and start Apache

  4. Apache should start this time with any luck


My situation was that when I used the command-line to run:

$ sudo apachectl stop

nothing changed. And when I used the command-line to run:

$ sudo apachectl start

I received the message

httpd (pid 600) already running

I tried restart instead and it worked.

Solution 13 - Macos

To fix this particular issue, I reinstalled PostgreSQL and the apache build that came with it, then I installed MAMP again and MAMP worked fine.

Solution 14 - Macos

If your htdocs (or equivalent) folder is stored on external storage, you may need to connect to it (in finder, or using cmd + K) before apache will start.

Solution 15 - Macos

I had this problem and it turned out that a .txt file that was not a vhosts file had somehow been saved to my sites-available folder that Apache was automatically including, and expected every file to be a vhosts file.

Solution 16 - Macos

Also make sure you're not launching an older version of MAMP. This happened to me when using spotlight to find MAMP. When the app upgrades, it keeps older copies around in your Applications folder.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionDjaveView Question on Stackoverflow
Solution 1 - MacosQullbruneView Answer on Stackoverflow
Solution 2 - MacosJose TorresView Answer on Stackoverflow
Solution 3 - MacosDonCristobalView Answer on Stackoverflow
Solution 4 - MacosjohnfleffView Answer on Stackoverflow
Solution 5 - MacosLucasView Answer on Stackoverflow
Solution 6 - MacosjamelView Answer on Stackoverflow
Solution 7 - MacosmicahmillsView Answer on Stackoverflow
Solution 8 - MacosBharathi AntonyView Answer on Stackoverflow
Solution 9 - MacosLukas KalinskiView Answer on Stackoverflow
Solution 10 - MacosJay VersluisView Answer on Stackoverflow
Solution 11 - MacosLuca ReghellinView Answer on Stackoverflow
Solution 12 - MacosdavesmithsView Answer on Stackoverflow
Solution 13 - MacosDjaveView Answer on Stackoverflow
Solution 14 - MacosDjaveView Answer on Stackoverflow
Solution 15 - MacosbethView Answer on Stackoverflow
Solution 16 - MacosdloewenView Answer on Stackoverflow