How do I enable the PHP debugger?

To enable PHP debugging, you must have PHP installed on your computer and you must also have xDebug extension added to your PHP setup.

Recommended Solution (beginner friendly)

To save time, you can use self-installing and self-configuring PHP and xDebug package. Click here to download it. After installing this package, make sure, the code editor is fully allowed in your firewall settings. Next time when you launch the editor, you should be able to set breakpoints and execute PHP scripts.

Advanced Solution

Step 1 - Download and install PHP

To run PHP scripts, you need the PHP interpreter installed. Visit www.php.net and download the latest PHP 5.x.x zip package (not the installer) from the Windows Binaries section. After downloading the zip file, extract PHP to some convenient folder.

Step 2 - Download xDebug extension

Go to www.xdebug.org and download xDebug Windows module for the PHP version you installed in the previous step. For example, if you have PHP 5.1.1 installed, you need the xDebug for 5.1.1

Step 3 - Add xDebug to PHP

Copy the downloaded xDebug DLL file in the folder containing other PHP extensions, for example, c:\php\ext When this is done, locate and open php.ini file. If there is no such file, locate php.ini-dist and rename it to php.ini. At the end of this file add the following lines:


[Zend]

zend_extension = "c:\php\ext\php_xdebug.dll"

xdebug.remote_enable = true

Replace c:\php\ext\php_xdebug.dll with the full path to your xDebug dll file.

Step 4 - Configure the code editor

On the Options menu, click Preferences and locate PHP Options. There you must specify the path to php.exe file which can be found in the folder where you installed the PHP.

Step 5 - Avoid possible problems

Make sure, the code editor is fully allowed in your firewall settings and then restart the program. Next time when you launch the editor, you should be able to set breakpoints and execute PHP scripts.