

We’ll clone Xdebug from Github and compile it: If you’ve followed my Setting Up a Debian VM, Step by Step tutorial then you should already have Xdebug installed and enabled. The steps to get Xdebug working in your favorite IDE/text editor will differ, but the basic steps should remain the same and you should refer to its documentation. It is not free (except for educational institutions or open source projects) at $99, but in my opinion this is a must-have tool that just works and is worth every penny.Įdit: It appears ActiveState Komodo IDE supports Xdebug, but the price tag of $295 may be too much to pay for many non-professional developers. PhpStorm is a full-fledged IDE that is developed by the same team that has created IntelliJ IDEA. My favorite IDE is JetBrains’ PhpStorm which provides native support for Xdebug and I will write this tutorial with it in mind. Some text editors have plugins for Xdebug support, like Notepad++, Sublime Text 2 and even Vim.
#Phpstorm ide key update#
I will keep an eye on this IDE’s status and update this article as soon as I see that it works. Netbeans has an issue ( 1, 2, 3) with Xdebug where it throws a socket exception while debugging, rendering it kind of useless for any real debugging sessions. PHPed has a proprietary “PHP Debugger” extension. For example, Zend Studio does not officially support Xdebug, and in my tests it simply does not work – you need to use their own Zend Debugger. Most modern IDEs support debugging of some sort, although depending on the IDE you may be required to use a different extension. It also allows you to change the values of one or more variables on the fly, affecting the execution of your application. 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.

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. It provides debugging and profiling capabilities, although I’ll be mostly focusing on the debugging aspects in this tutorial. Xdebug is a PHP extension that was written and is maintained by Derick Rethans.
#Phpstorm ide key how to#
In my Setting Up a Debian VM, Step by Step tutorial I showed you how to install and enable Xdebug on a VM but I didn’t really explain what Xdebug is, why you should use it, or how to actually begin working with it.
