February 14th, 2010How to Debug PHP Applications with NetBeans IDE and Xdebug on Windows?
After having tried many IDEs for PHP development, including Eclipse and Komodo Edit, I have found myself the most comfortable and productive with the excellent NetBeans IDE.
You can start building PHP applications with NetBeans right out-of-the-box by simply downloading NetBeans for PHP (version 6.8 is the latest as of this post). Debugging with it requires an additional download of Xdebug.
Here is a quick and step-by-step guide to quickly start developing and debugging your PHP application projects with NetBeans + Xdebug:
1. Download and install NetBeans IDE for PHP.
2. Download Xdebug (it’s a small DLL library file).
Advice: Among the plethora of download links available on that page, let me tell you that you generally wouldn’t want the ‘non-thread-safe’ version, so ignore that; go for the latest non-beta version. I downloaded 5.2 VC6 (32 bit) of Xdebug 2.0.5.
3. Next you need to make changes to php.ini found in apache\\bin folder (the location of your apache folder may vary depending on your installation, look for it).
Find “[Zend]” section in your php.ini file, which should look like the following:
1: [Zend]
2: zend_extension_ts = "E:\\Servers\\xampp\\php\\zendOptimizer\\lib\\ZendExtensionManager.dll"
3: zend_extension_manager.optimizer_ts = "E:\\Servers\\xampp\\php\\zendOptimizer\\lib\\Optimizer"
4: zend_optimizer.enable_loader = 0
5: zend_optimizer.optimization_level=15
6: ;zend_optimizer.license_path =
7: ; Local Variables:
8: ; tab-width: 4
9: ; End:
Xdebug is not compatible with Zend Optimizer, so comment out lines 2 to 5 (by prefixing the line with a semi-colon), and add the following lines under [Zend] section heading:
1: [Zend]
2: zend_extension_ts="E:\\Servers\\php_xdebug\\php_xdebug-2.0.5-5.2.dll"
3: xdebug.remote_enable=on
4: xdebug.remote_handler=dbgp
5: xdebug.remote_host=127.0.0.1
6: xdebug.remote_port=9000
Note: Remember to change the path and filename to match your Xdebug path and version.
4. Restart Apache (if using XAMPP: Open the XAMPP Control Panel and first stop, then start Apache).
5. To verify if Xdebug is configured properly for debugging, create a php file containing this one line:
1: <?php echo phpinfo() ?>
Save it in your htdocs folder [phpinfo.php], and open it in your browser [http://localhost/phpinfo.php]. If Xdebug is loaded successfully, you should see something like this:

That is it! Now you are ready to debug your applications with Xdebug using NetBeans IDE. Simply open your PHP project in NetBeans and press Ctrl + F5 or click
in the toolbar.
A detailed guide on configuring Xdebug with NetBeans can be found on this wiki: http://wiki.netbeans.org/HowToConfigureXDebug.
Happy coding!




February 14th, 2010 at 8:22 pm
[...] This cup of tea was served by: Zenning My Way Out! [...]
March 30th, 2010 at 3:45 pm
Hi, I’ve instaled NB IDE 6.8. I downloaded XAMPP 1.7.3 and xdebug 2.0.5 5.2 VC6 (32 bit). I did the steps above but even when i try to load the phpinfo.php file in the htdocs folder i get a 404 Error. Actualy I was checking and i don’t have the php.ini in the XAMPP/apache/bin folder, the only php.ini file that i have is at XAMPP/php folder. Am i missing a file or something?
May 18th, 2011 at 4:47 pm
hello,what an excellent article this is,I found it on bing and I like it very much,I agree with what you have said, lots of things will be learned form your site,but I still have some questions with the last part,can you explain it for me ?I will appreciate your answer,and I will be back again!
May 18th, 2011 at 5:57 pm
Were you aware that nearly 90% off adult a lot of women will experience some degree of cellulite inside their lifetimes? In case you have problems with unwanted cellulite, you certainly are not alone. The mass media has cast an ugly shadow with cellulite just by portraying it being problem tied to individuals who are obese or don’t care for themselves in physical form. Photos from celebrities with cellulite usually are constantly being splashed upon covers from tabloids worldwide like cellulite is some sort of personal failing. In reality, cellulite impacts a lot of women and is mostly a natural an important part of life. As you move the full trigger of cellulite is not really fully known, it is viewed as closely associated with hormones since it is rarely observed in men. The most frequent area meant for cellulite to create in over the thighs.