How can I find out which PHP script a process is running in Linux? How can I find out which PHP script a process is running in Linux? apache apache

How can I find out which PHP script a process is running in Linux?


pstree | grep phpps aux | grep phpps xuww | grep php...


In one SSH window:

telnet localhost 80

In another, find out the port number:

lsof -p `pidof telnet`

Then, to find out the process:

netstat -nap | grep {port}

And finally:

strace -o /tmp/output -f -r -s4096 -p {PID}

Will show you every process which runs when you make a httpd connection to the server in order. If you search through this list you'll find your PHP script.


Just use:

ps aux | grep php

Shows you php scripts running with their paths.