We help IT Professionals succeed at work.

Could you tell me if the only way to use debbuger in PHP is through the PHPStorm tool or are there any other ways?

Eduardo Fuerte
Eduardo Fuerte used Ask the Experts™
on
Hi Experts

Could you tell me if the only way to use debbuger( similar tha .net has, dinamically breaking line to line) in PHP is through the PHPStorm tool or are there any other ways and tools?

Thanks in advance!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Pretty much all of the debuggers are simply clients that connect to PHP via the XDebug extension. In other words, the XDebug extension on the server controls the execution of the script and ALLOWS the script to be paused, etc... Then there are different debugging clients that CONNECT to XDebug and know how to speak that language so that they can tell XDebug to pause and so on.

Think of XDebug as a cop who controls traffic manually when a traffic light is broken. That cop is always involved in the traffic flow, and he'll listen to the commands of anyone who knows how to talk to him.

That said, there are various debugging clients besides PHPStorm, although PHPStorm is probably the smoothest integration out there. Some of the others will work but take some effort to get working properly.

NetBeans has the capability to do this - here's their documentation page on how to do it:
https://netbeans.org/kb/docs/php/debugging.html

There's also NuSphere PHPed's debugger wizard:
http://www.nusphere.com/products/dbg_wizard_download.htm

And there's the free DBGP plugin for Notepad++:
https://sourceforge.net/projects/npp-plugins/files/DBGP%20Plugin/DBGP%20Plugin%20v0.13%20beta/

And a plugin for Visual Studio Code:
https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug

If you have a preferred IDE that you already use, there's a chance there's a plugin for it to support debugging - just Google for that IDE's name and "php debug" and if there's a plugin, it should be at the top of the search results.

All that said, I personally don't like this debugging approach for PHP. It requires XDebug and requires an opening in the firewall, and there's just a lot of setup to get it running. I use debuggers all the time in other languages (e.g. I do a lot of .NET desktop development), but for PHP, I find it far faster to just implement simple debugging outputs/logging to figure out how a script executed.
David FavorFractional CTO
Distinguished Expert 2018

Commented:
The answer to your question - yes, you'll use a PHP IDE.

gr8gonzo provided great resources for you to research.

Tip: Get XDebug working first. Then test the XDebug low level debug capabilities. You may find XDebug provides sufficient detail to handle many debugging requirements.

http://xdebug.org/docs/ covers XDebug installation + setup.
Eduardo FuerteDeveloper and Analyst

Author

Commented:
Thank you a lot for the guidance!