Page 1 of 1

Xdebug installation on Windows

Posted: Tue Jul 07, 2009 12:01 pm
by Dark Dominion
I'm trying to install xdebug 2.0.5 on windows xp sp3 to use it with Netbeans 6.7, but i can't even make it load when apache starts. My PHP version is 5.3 and the xdebug configuration on php.ini looks like this:

zend_extension_ts="C:\Webserver\PHP\ext\php_xdebug-2.0.5-5.3-vc6.dll"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp

When i try the php -m command on the console i don't see the xdebug module listed.

Re: Xdebug installation on Windows

Posted: Sat Jul 11, 2009 12:06 pm
by midix
I recently started development with Zend Framework and Netbeans 6.7 IDE. So the first thing I was looking for was how to debug. And came to xdebug.

There are some issues - you have to match xdebug versions carefully - multithreaded or singlethreaded, and appropriate xdebug versions for certain PHP versions. I have ApacheFriends XAMPP (Basispaket) version 1.7.1 for Windows, it has PHP 5.2.9. And the appropriate xdebug library already was there in ext folder!

My php.ini is located in G:\xampp\php (sometimes there were problems with multiple php.ini files so it was hard to guess which one is being loaded, but in latest XAMPP it is OK).

I have set php.ini following (Zend and Xdebug sections were already there by default, but XDebug was commented out):

Code: Select all

 
[Zend]
;; Only Zend OR (!) XDebug
;zend_extension_ts = "G:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
;zend_extension_manager.optimizer_ts = "G:\xampp\php\zendOptimizer\lib\Optimizer"
;zend_optimizer.enable_loader = 0
;zend_optimizer.optimization_level=15
;zend_optimizer.license_path =
; Local Variables:
; tab-width: 4
; End:
 
[XDebug]
;; Only Zend OR (!) XDebug
zend_extension_ts="G:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="G:\xampp\tmp"
 
So you see, if you have anything Zend related enabled, you have to disable it for development environment.

When I run phpinfo from XAMPP Admin page, I see the following in the first table:

Code: Select all

...
PHP Extension   20060613
Zend Extension  220060519 
...
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
    with Xdebug v2.0.4, Copyright (c) 2002-2008, by Derick Rethans
php -m shows

Code: Select all

[Zend Modules]
Xdebug
at the very end of list.

I also downloaded wincachegrind utility for inspecting xdebug.profiler files, have not tried it yet.

Now debugging with NB 6.7 works fine, although sometimes it is annoying, that it stops at the very beginning of each script although I need it to stop just at a breakpoint.

And I suggest to turn also
magic_quotes_gpc = Off
(by default it is on) because PHP manual says this setting is deprecated and will be dropped soon. And if you leave it on, you may have some issues with double escaping. You can also set this to off in .htaccess to be sure that your app works fine even on a servers where magic_quotes_gpc is on.


I hope, this info will be useful. It just hard to tell, why it does not work for you because I use almost fully preconfigured XAMPP package :wink:

Re: Xdebug installation on Windows

Posted: Sat Aug 01, 2009 4:42 am
by Dark Dominion
Well i changed the zend_extension_ts to zend_extension and it works great!

And now my configuration looks like this:

Code: Select all

zend_extension="C:\Webserver\PHP\ext\php_xdebug-2.0.5-5.3-vc6.dll"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
I hope this is helpful to everyone that has the same problem i had.

Re: Xdebug installation on Windows

Posted: Thu Aug 27, 2009 9:30 pm
by ywliu
http://www.php.net/ChangeLog-5.php#5.3.0

* Removed all zend_extension_* php.ini directives. Zend extensions are now always loaded using zend_extension directive. (Derick)


Yeah... I fell for this too... PHP quietly discards my xdebug line without any warning messages.

Re: Xdebug installation on Windows

Posted: Sun Sep 06, 2009 4:15 am
by JeffRubinoff
Is there really only one php.ini file now in XAMPP? xampp/php/php.ini?

Re: Xdebug installation on Windows

Posted: Mon Sep 07, 2009 7:04 am
by JeffRubinoff
Answering my own question, yes there is.
Also, you do not have to download Xdebug with XAMPP 1.7.2. It has an Xdebug dll included in it that works just fine. And you don't have to disable zend_optimizer in php.ini, either, because it isn't enabled.

Re: Xdebug installation on Windows

Posted: Mon Sep 21, 2009 5:38 pm
by jeff00seattle
I have Apache 2.2.13 (Win32) with PHP 5.3.0 VC9 Thread-Safe, and I did exactly as the doctor ordered...
Dark Dominion wrote:

Code: Select all

zend_extension="C:\Webserver\PHP\ext\php_xdebug-2.0.5-5.3-vc6.dll"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
And I tried this out for both php_xdebug-2.0.5-5.3-vc6.dll and php_xdebug-2.0.5-5.3-vc9.dll, and yes I restarted Apache 2.2.13 (Win32) each time. And Xdebug does not load!

1. With php_xdebug-2.0.5-5.3-vc6.dll, it did nothing.
2. With php_xdebug-2.0.5-5.3-vc9.dll, it faults with the following error message in event log:
With Faulting application name: httpd.exe, version: 2.2.13.0, time stamp: 0x4a7b422b
Faulting module name: php_xdebug-2.0.5-5.3-vc9.dll, version: 2.1.0.0, time stamp: 0x4a4c79bc
Other details...

Code: Select all

PHP 5.3.0 (cli) (built: Jun 29 2009 21:55:01)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
 
Compiler  MSVC9 (Visual C++ 2008)  
Architecture  x86
 
Debug Build => no
Thread Safety => enabled
Any recomendations?

Jeff in Seattle

Re: Xdebug installation on Windows

Posted: Wed Oct 21, 2009 2:48 am
by ppaul