How to determine which PHP script is running by having the PID in Linux

Issue

This Content is from ServerFault. Question asked by Fariborz Navidan

I have a cPanel server running LiteSpeed Web Server. There are a few Magento stores running on the server.

The issue is that I am continuously receiving notification from CSF/LFD stating that a process running under a specific user has exceeded the maximum allowed time and the process is running for a long time. The notification email contains the PID and the user under which the process is running. However, the command line only shows lsphp without mentioning the path to the running PHP script. I have tried to find out the main PHP script using lsof tool but it doesn’t show any open files inside /home directory. It just shows the running PHP binary and libraries which are open but not the main PHP script.

I would appreciate if anyone can help me find out what is actually happening on the server.



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from serverfault, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?