3

I'm having problems with XDebug.

Configuration as follows:

  • Windows 7 64bit
  • PHP 5.4.6 Thread Safe 32 bit
  • Apache 2.4 Thread Safe
  • Eclipse PDT 3.0.2

The problem is that xdebug_break() calls are not working, and breakpoints entered through Eclipse also don't function. I can see that the extension is working, as it appears as a module in phpinfo(). When I call an uncallable method, XDebug outputs the relevant error messages.

I've modified Eclipse's web server path mapping, to no avail.

Here is my php.ini config:

zend_extension = c:/php/php_xdebug-2.2.1-5.4-vc9.dll
xdebug.remote_enable = 1
xdebug.remote_host = localhost
xdebug.remote_port = 8080
xdebug.remote_mode = req

Any help would be kindly appreciated...

cmbuckley
  • 40,217
  • 9
  • 77
  • 91

2 Answers2

1

First check that what version you are using of PHP in eclipse.... Check it through: Window->preference->PHP->PHP Interpreter....

Version there should match with the PHP version.....

Reply if problem is not solved....

Priyank
  • 21
  • 2
1

For all those, that are still fighting with this problem, some handy tips.

Check which version (package) of Eclipse you have? It turns out, that Helios package has some bugs and doesn't stops on breakpoints, when you debug your application as Web Application. Debugging works only, if you run it as PHP Script. Which makes it pretty useless for debugging process.

You should consider either reverting to older Galileo Package Eclipse for PHP Developers or installing newest Eclipse Juno (or even newest developer version of Eclipse Kepler), which doesn't have PDT support build in, but you can easily add it to then, using Help > Install New Software.. (point it to http://download.eclipse.org/tools/pdt/updates/release).

These versions are reported to be able to debug as Web Application, respecting breakpoints.

Also, remember, that Xdebug must be run as Zend Extension in order to support breakpoints! In other words remove extension=xdebug.so (on Linux or xdebug.dll on Windows) line from your php.ini and replace it with zend_extension=/full/path/to/xdebug.so (on Linux or zend_extension=X:\full\path\to\xdebug.dll on Windows). Zend extensions requires full path, even if they're put into /php/ext folder, as regular PHP extensions. You'll find more info on this in Xdebug FAQ (look for an answer to "Xdebug is only loaded as PHP extension and not as a Zend Extension" question).

Community
  • 1
  • 1
trejder
  • 17,148
  • 27
  • 124
  • 216