Search code examples
phpmacosapachemamp

MAMP : Apache not starting while httpd is already running


I have strange problem here. I was installing mcrypt on my mac running yosemite and MAMP 3.0, PHP 5.6.1

Extension seemed like installed successfully. But when I restarted mac, MAMP was unable to start Apache, while mysql was running very fine.

I came to know that port 80 in blocked. httpd is already using it. I tried restarting several times but it is already in use. I have very little idea about apache using httpd to run server.

I can run apache on different port (8080, here) but I don't want to run it entering :8080 each time while testing on localhost.

Any help really appreciated,


Solution

  • That is because OSX automagically starts its own installed version of apache. The only way i found of getting rid of it is this : after boot, in a Shell,

    sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
    

    edit : the unload command above permanently prevents the daemon from re-spawning. After a reboot, if you

    DarkMax:~ yvesleborg$ sudo launchctl unload /System/Library/LaunchDaemons/org.apache.httpd.plist
    Password:******
    

    you should get :

    /System/Library/LaunchDaemons/org.apache.httpd.plist: Could not find specified service
    

    you should avoid at all cost changing the content of the /System/Library/LaunchDaemons folder outside of the launchctl command.