News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Juan Treminio's Blog:
Xdebug and You Why You Should be Using a Real Debugger
July 05, 2012 @ 08:52:13

If you've been working with PHP for any length of time, you know that one of the issues the language has shows up when you're trying to debug your applications. Thankfully, as Juan Treminio points out, there's a better way - Xdebug.

Xdebug is a PHP extension that was written and is maintained by Derick Rethans. It provides debugging and profiling capabilities, although I'll be mostly focusing on the debugging aspects in this tutorial. With it you can set a breakpoint and pause the execution of a script to see the state of your application at that exact point, including what variables/objects have been instantiated and what their values are. Xdebug completely replaces the need to litter your code with echo, print_r() or var_dump() calls, and displays information on all variables, not just the one you passed.

He talks some about the current state of IDE/editor support for the tool and shows how to get it installed and your php.ini configured to use it. XDebug make it easy to turn on/off debugging thanks to a handy browser-based switch. He links to a bookmarklet you can use to make it a one-click operation. He includes the setup for using the debugging in PHPStorm, but it's pretty similar for most of the IDEs out there.

0 comments voice your opinion now!
xdebug debugging install configure ide bookmarklet


blog comments powered by Disqus

Similar Posts

Norbert Mocsnik's Blog: Setting Up DokuWiki with Simple Authentication

Felix Geisendorfer's Blog: Setting up Xdebug on Mac OS X (or Win32 / Linux)

PHPBuilder.com: Clustered File Systems and PHP

Davey Shafik's Blog: Netbeans for PHP: Continues to Impress

ServerGrove Blog: Running Composer with HHVM, not so fast!


Community Events





Don't see your event here?
Let us know!


series release opinion library laravel framework podcast voicesoftheelephpant symfony tool security introduction version package composer install community language interview update

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework