When I run a PHP script through browser ( HTTP connection) the PID is printed for debugging, but when this request is closed by clicking the browser's Stop button, or closing this browser tab, I still see the process when I run ps -aux
in terminal.
www-data 2613 0.0 1.2 42320 12968 ? S 17:14 0:00 /usr/sbin/apache2 -k start
How long this process will keep lurking for no reason? And should one worry about many of those zombies in production? Given that, the PHP script does nothing but printing the PID, sleeps for 5 seconds, and then ends.
It generally isn't something to worry about. Each process handles multiple http requests as standard.
If you are seeing more than 20 then there could be a problem. The default on most distros is between 10 and 20 spare apache servers.