Xdebug installation on Windows

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Xdebug installation on Windows

Postby Dark Dominion » Tue Jul 07, 2009 12:01 pm

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.
User avatar
Dark Dominion
Forum Newbie
 
Posts: 6
Joined: Mon Aug 11, 2008 11:59 am
Location: Athens, Greece

Re: Xdebug installation on Windows

Postby midix » Sat Jul 11, 2009 12:06 pm

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):

Syntax: [ Download ] [ Hide ]
 
[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:

Syntax: [ Download ] [ Hide ]
...
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
Syntax: [ Download ] [ Hide ]
[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:
midix
Forum Newbie
 
Posts: 3
Joined: Fri Jul 10, 2009 3:51 pm

Re: Xdebug installation on Windows

Postby Dark Dominion » Sat Aug 01, 2009 4:42 am

Well i changed the zend_extension_ts to zend_extension and it works great!

And now my configuration looks like this:

Syntax: [ Download ] [ Hide ]
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.
User avatar
Dark Dominion
Forum Newbie
 
Posts: 6
Joined: Mon Aug 11, 2008 11:59 am
Location: Athens, Greece

Re: Xdebug installation on Windows

Postby ywliu » Thu Aug 27, 2009 9:30 pm

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.
ywliu
Forum Newbie
 
Posts: 2
Joined: Wed Dec 24, 2008 11:45 pm

Re: Xdebug installation on Windows

Postby JeffRubinoff » Sun Sep 06, 2009 4:15 am

Is there really only one php.ini file now in XAMPP? xampp/php/php.ini?
JeffRubinoff
Forum Newbie
 
Posts: 2
Joined: Sun Sep 06, 2009 4:13 am

Re: Xdebug installation on Windows

Postby JeffRubinoff » Mon Sep 07, 2009 7:04 am

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.
JeffRubinoff
Forum Newbie
 
Posts: 2
Joined: Sun Sep 06, 2009 4:13 am

Re: Xdebug installation on Windows

Postby jeff00seattle » Mon Sep 21, 2009 5:38 pm

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:
Syntax: [ Download ] [ Hide ]
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...
Syntax: [ Download ] [ Hide ]
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
jeff00seattle
Forum Commoner
 
Posts: 66
Joined: Sat Feb 28, 2009 4:27 pm

Re: Xdebug installation on Windows

Postby ppaul » Wed Oct 21, 2009 2:48 am

ppaul
Forum Newbie
 
Posts: 1
Joined: Wed Oct 21, 2009 2:46 am


Return to Installation and Configuration

Who is online

Users browsing this forum: No registered users and 3 guests