Posts Tagged ‘pid’

Get a PHP Script’s Own Linux PID (Process Id)

By marc • May 14th, 2008

Previously, I wrote this article on how to check the status of a known system PID from PHP. I figured that I would follow it up with another short article on how to determine the process id of a running PHP script from within itself. Many google searches seem to have led people to the […]



Check if Linux Process is Still Alive from PHP

By marc • Apr 28th, 2008

At some point you may need to figure out if a system process is still running from within a PHP application. The secret is by running a system command from PHP that returns the information for a specific process id (PID).
The normal shell command would be something like this:

 

$ ps 4946

Which would return something like […]