HOWTO: XDebug, XAMPP 1.6.6a for Windows - version mismatch

Problems with the Windows version of XAMPP, questions, comments, and anything related.

HOWTO: XDebug, XAMPP 1.6.6a for Windows - version mismatch

Postby JSpaceCadet » 27. February 2008 23:12

HOWTO: Make XDebug and XAMPP 1.6.6a for Windows work together.

Hello,
I want to share some experience I had recently getting XDebug to work with XAMPP 1.6.6a. It seems the version of XDebug (php_debug.dll) that ships with XAMPP 1.6.6a is the wrong version and an upgrade needs to be made. The version mismatch is a big problem - a show-stopper.
Plus I give simple instructions you can follow on everything you need to do to actually get XDebug working including modifying the .ini file and replacing the old php_xdebug.dll files. I think you will find this is both comprehensive and simple.

Here is what I needed to do to get the system working from the ground up:

Thanks to Derik at XDebug.org in helping me find that php_xdebug.dll that ships with XAMPP 1.6.6a for Windows appears to be the wrong one.

Background: For my application I need both a debug version of PHP and a non-debug version, so I have 2 .ini files - php.ini and php_debug.ini. Most of you will just one if you want to have PHP work in debug mode all the time.

Download and installed XAMPP 1.6.6a for Windows from:
http://www.apachefriends.org.

Install XAMPP to c:\xampp, the default directory.

Download php_xdebug-2.0.2-5.2.5.dll from:
http://www.xdebug.org

The site currently has it labeled "PHP 5.2.1-5.2.7".

The current download URL is:
http://www.xdebug.org/link.php?url=xdebug202-52-win .

Please keep in mind these locations might change.

Change to PHP directory:
cd c:\xampp\php

Make backup and debug versions of php.ini
copy php.ini php.orig
copy php.ini php_debug.ini

Rename the current xdebug files for safe-keeping:
ren ext\php_xdebug.dll php_xdebug.dll.orig
ren extensions\php_xdebug.dll php_xdebug.dll.orig

Copy the xdebug file you downloaded for PHP. Use your own download directory instead of c:\download:
copy c:\download\php_xdebug-2.0.2-5.2.5.dll ext
copy c:\download\php_xdebug-2.0.2-5.2.5.dll ext\php_xdebug.dll
copy c:\download\php_xdebug-2.0.2-5.2.5.dll extensions
copy c:\download\php_xdebug-2.0.2-5.2.5.dll extensions\php_xdebug.dll

OK. That does it for moving files around.

Now, open php_debug.ini for editing:
notepad php_debug.ini

Comment out everything under the [Zend] section:
[Zend]
;;;zend_extension_ts = "C:\xampp\php\zendOptimizer\lib\ZendExtensionManager.dll"
;;;zend_extension_manager.optimizer_ts = "C:\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:

Un-comment everything under the [XDebug] section:
;[XDebug]
; Only Zend OR (!) XDebug
zend_extension_ts="C:\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="C:\xampp\tmp"

Now if you run PHP with the version parameter you should see that XDebug is loaded:

C:\xampp\php>php -v -c php_debug.ini
PHP 5.2.5 (cli) (built: Nov 8 2007 23:18:51)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Xdebug v2.0.2, Copyright (c) 2002-2007, by Derick Rethans

One more thing. You might be tempted to enable the line:
;extension=php_xdebug.dll
under the ; Windows Extensions label. *Don't*. I am really not clear what is supposed to happen when you do that, but I just get lots of error messages.

One possible issue is that using this newer version of php_xdebug.dll in both the php\ext and php\extensions might cause PHP4 to break. I haven't testing in that scenario as I am developing currently under PHP5. Let me know if you find this is the case and we can look at altering this solution to include support for PHP4 - if it's a problem.

That's all there is to it.

I hope this helps someone out there. It was a tough problem to diagnose so it would be nice if it helped more than just me.

Please let me know if you found this helpful and also if you found problems with it that I can address.

Sincerely,
Joe
JSpaceCadet
 
Posts: 1
Joined: 27. February 2008 22:22

Postby Wiedmann » 28. February 2008 00:53

One possible issue is that using this newer version of php_xdebug.dll in both the php\ext and php\extensions might cause PHP4 to break.

That's correct.
"\xampp\php\ext" --> PHP5 extension
"\xampp\php\extensions" --> PHP4 extension

So, if you use PHP4, you have to download a PHP4 version of XDebug [1], if the included PHP4 extension is not working.

[1] http://xdebug.org/link.php?url=xdebug202-44-win
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Thanks!

Postby kshep » 25. May 2008 19:25

I hope this helps someone out there. It was a tough problem to diagnose so it would be nice if it helped more than just me.

Well you just saved me a ton of time. Who knows how much. This was the first thread I came across trying to troubleshoot the problem.

Thanks! :D
kshep
 
Posts: 1
Joined: 25. May 2008 19:20

Re: HOWTO: XDebug, XAMPP 1.6.6a for Windows - version mismat

Postby twbeebe » 25. May 2008 23:24

JSpaceCadet wrote:HOWTO: Make XDebug and XAMPP 1.6.6a for Windows work together.

Hello,

<snip>
Being a newbie to the Apache Project, I have been doing alot of reading within the various forum areas and since yours was a current Bug Fix, I decided to apply your information. Everything up to this point followed and executed well. EXCEPT, that my Full Auto-Install did not provide the following files, to be corrected ?
<snip>
Rename the current xdebug files for safe-keeping:
ren ext\php_xdebug.dll php_xdebug.dll.orig
ren extensions\php_xdebug.dll php_xdebug.dll.orig
<snip>
Now if you run PHP with the version parameter you should see that XDebug is loaded:

C:\xampp\php>php -v -c php_debug.ini
PHP 5.2.5 (cli) (built: Nov 8 2007 23:18:51)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Xdebug v2.0.2, Copyright (c) 2002-2007, by Derick Rethans
<snip>
This did pull up fine, but I'm not sure if I need what I have done, or whether I am going to have further problems because I did ? Your insight would be helpful while I pull up this system for ZenCart usage.

Thank you,

Toby.
<snip>

Please let me know if you found this helpful and also if you found problems with it that I can address.

Sincerely,
Joe
Thank you,

Toby.
twbeebe
 
Posts: 5
Joined: 25. May 2008 17:31
Location: Penryn, CA

fantastic

Postby chulee » 24. June 2008 23:47

That post was great, your coments help me to solve my problem with xdebug, thanks you.
chulee
 
Posts: 1
Joined: 24. June 2008 23:33


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 91 guests