Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Running Linux, Apache, PHP 5.3 with FastCGI Handler.

Is it possible to find out the script that is being executed for a linux process? I've been searching on google and haven't been able to find anything useful.

like image 388
Mike Avatar asked Feb 27 '12 16:02

Mike


People also ask

How can I see what processes are running PHP?

Depending on your setup this could be managed via fast-cgi or mod_php or even php-fpm. If you use mod_php , then there will be no "php processes" visible for ps . You can still see if your PHP engine is in use by using lsof : $ lsof -ln [...]

How do I view a PHP file in Linux?

Open Terminal using Ctrl + Alt + T , now type sudo -H gedit , then type your password and press enter . This will open the gEdit program with root permission. Now open your . php file where it's located or just drag the file into gEdit.

Where does PHP get executed?

PHP code is executed on the server.


1 Answers

pstree | grep php ps aux | grep php ps xuww | grep php ... 
like image 185
Qian Avatar answered Oct 02 '22 14:10

Qian