Jintor Posted October 14, 2021 Share Posted October 14, 2021 (edited) CONTEXT : I have many php scripts executing live... WHAT I DO : pgrep -ia php (to get details of the process containing php...) option -ia show the command... WHAT I GET : 112233 /opt/cpanel/ea-php80/root/usr/bin/php-cgi 223355 /opt/cpanel/ea-php80/root/usr/bin/php /home/..some.php QUESTION : The php processes that shows the executing file are ..../bin/php The php processes that don't show the command have ..../bin/php-cgi `/opt/cpanel/ea-php80/root/usr/bin/php-cgi` => How can I digg deeper to understand what php is doing in those processes ? they run for long time, can I kill them without causing problems ? what is they comes back, how can I pinpoint if there is a bad line of code executing ?? (note : I checked error_log file => no error are being reported) but thoses php-cgi tends to come back.... why ? WHAT I TRIED {1} : pidstat -p 112233 Linux 4.18.0-305.19.1.el8_4.x86_64 (host.example.com) 2021-10-14 _x86_64_ (8 CPU) 05:08:53 PM UID PID %usr %system %guest %wait %CPU CPU Command 05:08:53 PM 1001 1234277 0.00 0.00 0.00 0.00 0.00 6 php-cgi WHAT I TRIED {2} : pstree -aps 112233 systemd,1 --switched-root --system --deserialize 17 └─httpd,3515834 -k start └─httpd,1233812 -k start └─php-cgi,112233 WHAT I TRIED {3} : lsof -p 1234277 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME php-cgi 1234277 stubfeed cwd DIR 252,1 32 62973745 /home/user/public_html/.... php-cgi 1234277 stubfeed rtd DIR 252,1 4096 128 / php-cgi 1234277 stubfeed txt REG 252,1 6387136 138429576 /opt/cpanel/ea-php80/root/usr/bin/php-cgi php-cgi 1234277 stubfeed DEL REG 0,1 110106200 /dev/zero php-cgi 1234277 user mem REG 252,1 315112 578898832 /opt/cpanel/ea-php80/root/usr/lib64/php/modules/mailparse.so php-cgi 1234277 user mem Edited October 14, 2021 by Jintor Quote Link to comment https://forums.phpfreaks.com/topic/313998-binphp-cgi-how-to-digg-deeper-and-understand-whats-happening-in-those-process/ Share on other sites More sharing options...
Jintor Posted October 14, 2021 Author Share Posted October 14, 2021 digging on the web I found this ps eax |grep php |grep -v grep|awk '{print $1 $8 $15 $19}' it shows PID - REDIRECT_SCRIPT_URL= ..... usefull stuff to know at least what php "could" have a bad infinite loop on the code.... Quote Link to comment https://forums.phpfreaks.com/topic/313998-binphp-cgi-how-to-digg-deeper-and-understand-whats-happening-in-those-process/#findComment-1591070 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.