Server Fault is a question and answer site for system and network administrators. 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

Sometimes, Apache decides not to shut down nicely. killall apache2 or kill -9 (apache2 PID here) shuts it down so that it can actually start back up without the port being in use. Other posts seem to indicate that PHP 5.2 might have issues hanging up Apache. I'm using the worker MPM on an x86_64 Gentoo Linux system if that helps.

Any other things I should consider hanging up Apache besides PHP? Should I be stopping Apache with /etc/init.d/apache2 gracefulstop instead of /etc/init.d/apache2 stop?

share|improve this question
Are you using mod_php or CGI? If CGI are you using just CGI by itself or mod_fastcgi or mod_fcgid? – DerfK Jan 5 '11 at 18:59
I'm using mod_php. – ZiggyTheHamster Jan 26 '11 at 22:02
You should switch to the new PHP slotting system, which allows 5.2 and 5.3 to coexist, because there are no more updates to the (5) slot. You will have 5.2.17 in the new (5.2) slot, which may solve that problem. I have the same apache version, worker, x86_64 on a large traffic server with PHP 5.2.17, without issues. See this howto: – Prof. Moriarty Feb 18 '11 at 1:50
I haven't updated my question but I did switch to the :5.2 slot. Didn't help. What did help is switching to the prefork MPM. – ZiggyTheHamster Mar 11 '11 at 16:25
up vote 0 down vote accepted

Switching to the prefork MPM fixed this problem at the expense of more memory usage. My guess is that there's some sort of concurrency issue that prevents all of the worker threads from stopping correctly. Also PHP doesn't recommend using anything besides prefork, so there's probably a good reason for that.

share|improve this answer

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.