25.Mar.2021
Linux find php file by process id
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
Enim tempor eget pharetra facilisis sed maecenas adipiscing. Eu leo molestie vel, ornare non id blandit netus.
Recent Posts
14.Aug.2023 | codedrill | Programming
Cracking the Code: Improving Problem-Solving Skills in Coding with 7 Expert Strategies
In programming, improving problem-solving skills are the key to unlocking new levels of expertise and
2.May.2023 | codedrill | Artificial Intelligence
OpenAI API
The OpenAI API can be applied to virtually any task that involves understanding or generating natural