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