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