Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been using mamp for a while now and everything has been working great. Then today I go to start it up and mamp alert tells me that apache is already running on that port and to pick another one. So without starting mamp, I type in local host in the web browser - my usual way to get to the sites that I'm developing - and a page pops up and it reads IT WORKS!, which tells me that I have an index.php file somewhere on my computer that echos It works!. But mamp is not running and I can't find this stupid it works file anywhere. Is there any way to diagnose this and perhaps kill this apache server so that I can start mamp back up without switching my ports?

share|improve this question
up vote 0 down vote accepted

If mamp is the only server you're running locally, you might want to try opening activity monitor, look for all running myslqld processes and quit them, then restart Mamp

or, as asked, through the terminal: killall -9 mysqld

share|improve this answer

You can use lsof to find out which processes are listening on which ports.

For example:

lsof -Pnl +M -i4 | grep ":80"

(assuming the process is running on port 80)

You can then use ps to figure out the name of the process for that processID:

ps -p <pid>
share|improve this answer
Thanks that helps a lot. Is there any way to then somehow kill that connection from the terminal? – Scott Nov 20 '11 at 23:39
Thanks, that not only helped me with my previous problem, it also helped figure out how to kill this stupid carbonite process (annoying pop-up that wouldn't go away). – Scott Nov 21 '11 at 15:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.