Search code examples
xdebugphpstorm

Response not returned for specific requests when xdebug running


I'm quite positive this is an xdebug issue and not a PHPStorm issue but to be clear up front I am using PHPStorm locally to debug PHP code residing on a remote server. I have xdebug set up on the server and am using the following config in php.ini on the server:

zend_extension=/home/httpd/php_extensions/xdebug-2.1.4/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_connect_back=1
xdebug.idekey=PHPSTORM-XDEBUG

I have set up PHPStorm as my local debugger. I use XDebug Helper in Chrome or easy Xdebug in Firefox to initialize xdebug (my problem occurs regardless of which I use). In general, debugging works fine. I can set breakpoints, step through code, see variables, etc.

The problem comes when certain requests never receive a response from the server. The server just never responds and I've validated this with Charles Web Debugging Proxy. This always happens on the same specific requests and happens regardless of whether breakpoints are set or not. The requests that don't receive a response are all similar--they call a php script which minifies and concatenates multiple JavaScript files and echos the result.

To troubleshoot, I've enabled xdebug logging by adding this to php.ini:

xdebug.remote_log=/home/httpd/xdebug.log

When I grep the log for the name of the php file being hit as the endpoint for these problematic requests I get 0 results (unless I've explicitly added breakpoints to that endpoint). When I do add breakpoints to that endpoint (minify.php) I can step through it in PHPStorm just fine and it seems to make it through the code even through echoing out the minified and concatenated JS code--yet the response is still never sent from the server as far as my local machine is aware.

Any idea what's going on here? It's really hampering my ability to use xdebug. Thanks.


Solution

  • Thanks for the response. That wasn't the problem but it led me to dig further. It turns out to be a bug where xdebug crashes when php calls exit(). Using the latest release candidate fixed the problem as specified here:

    http://bugs.xdebug.org/view.php?id=815

    Thanks!