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
?
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 theworker
threads from stopping correctly. Also PHP doesn't recommend using anything besidesprefork
, so there's probably a good reason for that.