Linux find php file by process id
25.Mar.2021
Sometimes on dedicated hosting, there can be some scripts that will start consuming 100% of CPU and all the websites will stop working.
We can find out the process list using this command:
top -i
It will tell us the process id, but still, we won’t be able to find out which PHP file might have created this process.
sudo lsof -p PID(process id which is taking up cpu)
This will show a list of files that are using this particular process. And anything matching your apache root directory (mostly /var/www/html/….) is the culprit.
** you might need to install lsof using :
sudo apt-get install lsof
Related article:
Leave a Reply
We'll try to resolve your queries asap.
Recent Posts
22.Jan.2024 | codedrill | Drupal
Drupal 7 to 10 migration services
Hire Codedrill for Drupal 7 to Drupal 10 migration. We also offer complete drupal development services from
11.Jan.2024 | codedrill | Apache, Hosting, Linux, MySQL, PHP
Install php 8.2, mysql, apache, phpmyadmin on ubuntu 22
All the new CMS and frameworks have started support for php 8.2. And it is quite easy to install php8.2 on