PHP Classes
elePHPant
Icontem

debugging stuck apache/php thread on production server

Recommend this page to a friend!

      Top level forums  >  Site  >  Features  >  debugging stuck apache/php thread on...  >  (Un) Subscribe thread alerts  
Subject:debugging stuck apache/php thread on...
Summary:I have a linux system with apache httpd and PHP which is loaded
Messages:1
Author:shaunmake
Date:2017-01-26 10:06:51
Update:2017-01-26 11:15:04
 

  1. debugging stuck apache/php thread on...   Reply   Report abuse  
shaunmake - 2017-01-26 11:15:04
I have a linux system with apache httpd and PHP which is loaded using LoadModule php5_module /usr/lib/apache2/modules/libphp5.so.

I've enabled the mod_status module of apache and I see a particular thread which is stuck doing something since yesterday. I also confirm this by doing ps -axu | grep apache which among the many threads it gives me that particular stuck thread:

www-data 5636 0.0 0.1 423556 23560 ? S XXXXX 0:04 /usr/sbin/apache2 -k start

Note that XXXXX is something like Jan02 which is yesterday. Also, the pid (5636) matches the pid of the stuck thread I see in the mod_status page of apache.

My question is: how can I do a thread dump or something similar in order to see where exactly in the PHP code this thing is stuck? Maybe it's waiting for something (i/o, network, db) but I don't know what.

In the java world I'd do a kill -3 pid and get a nice readable thread dump which would clearlly show me where exactly that particular thread is stuck at. Is there a similar technique for the php land? http://www.phptherightway.com/