开发者

Can't get Xdebug to work on Windows 7

I installed the latest XAMPP package which includes PHP 5.3.0. I am trying to enable Xdebug, but it just won't work.

Here's what I changed in the php.ini shipped with XAMPP:

; uncommented
zend_extension = "X:\xampp\php\ext\php_xdebug.dll"

; added the following lines:
xdebug.remote_enable=true
xdebug.remote_host=localhost
xdebug.remote_p开发者_如何学Goort=9000
xdebug.remote_handler=dbgp

Apache starts fine, but when I open http://localhost/ in my browser, I get the following error:

Can't get Xdebug to work on Windows 7

If I click the Close the program button, the error message will reappear in a second as if it was in an infinite loop. I'd greatly appreciate any help in getting this to work.

I am running a fresh install of Windows 7 Ultimate 64-bit.

EDIT: From the result of phpinfo():

Zend Extension Build    API220090626,TS,VC6 
PHP Extension Build     API20090626,TS,VC6 
Debug Build             no 
Thread Safety           enabled


It's possible you have the wrong version of Xdebug. I would take a look at phpinfo() and compare the information there to the different versions of the Xdebug dll.

Specifically, you want to see if "Thread Safety" is enabled, and you need to know whether you're running a VC6-compiled PHP or a VC9 (if you're using Apache, it's almost guaranteed that you want the VC6).


Have you tried custom installation wizard of XDEBUG, it analyses your php installation and provides exact steps you need to follow

The Windows binaries generally work for every mini release for the mentioned PHP version, although the extension is built against the most current PHP version at that time. The VCx marker tells with which compiler the extension was built, and Non-thread-safe whether ZTS was disabled. Those qualifiers need to match the PHP version you're using. If you don't know which one you need, please refer to the custom installation instructions.

http://xdebug.org/wizard.php

Just paste your phpinfo out put in the text box and you will get exact xdebug dll you would need for your php


frank-ly, I also had 2 REALLY bad days, and I don't now what finally fixed it, so here's my collection of Do's and pitfalls:

; this is the thread safe version,
; the absence of _nts_ in the dll name 'shows' this
; do not use _ts, your library won't get registered and won't show in phpInfo()
zend_extension = "D:/wamp/bin/php/php5.3.8/zend_ext/php_xdebug-2.1.2-5.3-vc9-x86_64.dll"

check your php.ini, check phpinfo() if all values (arrive)

xdebug.remote_enable = on
xdebug.remote_handler=dbgp
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
; if you have multiple virtual hosts ( like 'local.fooclient' )
; maybe using the IP is safer (for any same-machine-debugging)
xdebug.remote_host=127.0.0.1
; maybe a -much- lower port helped, 84 was free. use netstat to figure out.
xdebug.remote_port=84
; idekey! also see note below
xdebug.idekey=netbeans-xdebug

More Pitfalls:

I have seen a typo of xdebug.remote_handle (without r) several times on the web. beware.

A note on the idekey: The above idekey did show in phpinfo() as master value, BUT was overridden with a 'local value' like MYMACHINENAME$. ==> Setting a global env var (in computer properties) named DBGP_IDEKEY and rebooting (or maybe just logging out) to (also) netbeans-xdebug helps! Again: re-check in phpInfo() it took effect.

Of course adjust netbeans-menu:options->php tab->debugging section to this port and session id.

Here is a script, to check (by php means) if that port you intend to talk to is open. (further below also in the comments, for those to lazy too type from the image)

For your browser to connect, don't start to forget (amidst frustration) to always attach the debug-starting get-argument:

  http://localhost/myTest.php?XDEBUG_SESSION_START=netbeans-xdebug

On the port frontier, also this tool might help.

Quadruplecheck you are keeping VC6 and VC9 compiled versions of everything apart.

Running your whatever/path/php.exe myTest.php from the command line (once the above settings are done) might also reveal additional errors (it did, while I was tinkering with an incorrect dll).

I can recommend http://www.wampserver.com (for personal reasons it fits me better than the popular xampp package...)


Yes, there is a known problem - is almost impossible to get Xdebug working with latest Xampp and 64-bit Vista/Win 7.

There is a bug reported with many users complaining about it.

The solution seems to be latest beta version on Xampp. It includes version 2.0.6 (dev) of xdebug and it is working just fine.

I tested it on 64-bit Vista for approx 10 days and not encountered any problem yet.


When xdebug is installed not with XAMPP, just with PHP (32bit, TS, VC6, in C:\Program Files (x86)\PHP) and Apache (32bit) on Windows 7 (64bit), in php.ini you need to specify the full path to x86 folder of Program Files like.

zend_extension="C:\Program Files (x86)\PHP\ext\php_xdebug-2.1.1-5.3-vc6.dll"

and NOT

zend_extension="C:\Program Files\PHP\ext\php_xdebug-2.1.1-5.3-vc6.dll"

This was my mistake, when changed to x86 folder, xdebug started to work perfectly. Hope this help you, too.


Like others have said, you need to match your xdebug version with your php version.

You've already matched up PHP version number, thread safety, and compiler.

If you haven't already figured it out (this is an old thread), what you're missing is the INI configuration. If you are loading a module that's thread safe, you need to use the following line:

zend_extension="C:\Path\To\The\Extension.dll"

If the module is not thread safe, then you use the INI directive you've been trying to use.

This only applies to zend_extension's and not regular extensions.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜