How can I find out which PHP script a process is running in Linux?
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.