Join Jon Peck for an in-depth discussion in this video Xdebug remote debugging with NetBeans, part of Debugging PHP: Advanced Techniques.
NetBeans 7.2 has Xdebug support built into it, but some minor configuration is needed first.…I'll need to change the default debugging configuration.…Edit the NetBeans preferences, click PHP, then Debugging.…Uncheck Stop at the First Line, which would pause execution when it reaches …the first line, which I find distracting and I always skip. Click OK.…Right-click the Project and go to Properties.…
Under Run Configuration, specify the PROJECT URL.…In my case it's sandbox.dev.8080, click OK.…NetBeans is now configured to work as a debugger.…I've described the NetBeans debugging workflow, now I'll demonstrate it.…For NetBeans, I'm going to set a breakpoint.…Scroll down to the var dump xdebug_get_declared vars and left-click …just to the left of the line number.…The entire line will be highlighted in red.…
This means a breakpoint will be set, so Xdebug will pause execution on that line.…At the top of the toolbar, click the green arrow with a breakpoint icon …to start the debugger and launch the browser.…
This course covers installation of Xdebug on Apache as well as working with the NetBeans IDE (integrated development environment). Jon then introduces native web browser developer tools for Firefox and Chrome, and demonstrates browser independent web debugging tools. Best practices for debugging and profiling web application failures and performance issues are also covered.
- Configuring PHP error reporting
- Logging errors to file
- Gracefully handling fatal errors
- Installing Xdebug
- Understanding the principles of remote debugging
- Remote debugging with NetBeans
- Extending your browser with Firebug, FirePHP, or ChromePHP