Eclipse, XDebug, Apache and a Segmentation Fault
Or an alternative title: “Be very careful when you cut and paste from web pages”.
I’m a bit tired of doing var_dump debug on PHP, as today I debug lot of PHP lines every day and use complexer architectures as Joomla! CMS than simpler LAMP, I need to set up Eclipse to work with XDebug so I can debug remote pages more easy and, more important, faster.
I’ve had installed Eclipse yet, but I’ve not found the time to set up XDebug. Now I’ve it working, but I’ve at least one hour with a problem: Every time I wanted to debug a file with Eclipse + XDebug, my Firefox says me that I must download the php script instead of execute it. It was not a problem of Apache configuration, because it only occured using XDebug, without XDebug everything worked right.
Taken a look to the Apache’s error log file, I found two segmentation faults that happened exactly when I started trying to debug my test script:
[Fri Mar 20 17:27:04 2009] [notice] child pid 12801 exit signal Segmentation fault (11)
[Fri Mar 20 17:27:04 2009] [notice] child pid 14095 exit signal Segmentation fault (11)
I’ve to searched a bit for this problem on google, until I found this that put me on the right way to solve the problem.
As I explained in this comment in the same place, the problem was that I’ve cut’n'pasted the configuration on the xdebug.ini from this other site, but at first I didn’t notice that the quotes was not “real” quotes (I mean char decimal code 34 on ASCII table), but extended UTF-8 chars:
xdebug.remote_enable=On
xdebug.remote_host=”localhost”
xdebug.remote_port=9000
xdebug.remote_handler=”dbgp”
Looking at them now its pretty clear the difference, specially putting them side by side:
" ”
But when you’re in a hurry (and in my case, that’s about 101% of the time I past in front of this computer…) it easy than you don’t notice it.
As soon as I’ve changed the bad quotes by the good ones, everything started to work fine.
I think XDebug should take care of this giving a “Syntax error” on configuration file or so, instead of segfault, but that’s another history anyway… the important thing is, in the end, that you should be careful when you cut and paste from web pages, since it may be not only a mistake, I think even in some circunstances it may turn even into a security problem.


yeah! you gotta big mind to think!