PHP debugging with xdebug , dbgp and notepad++ (windows)

Sometimes we don’t need an IDE to develop some simple projects. So many people use basic editors like notepad++ under windows. Surprisingly, they are able to debug your PHP scripts. With the help of plugins. Here is the tutorial.

1. you need to install notepad++. If you don’t have it installed, of course. It’s homepage is, here is the direct link to executable

2. go to xdebug downloads page and download the version you need. For PHP 5.2.x you need <= 2.1.0beta3, for 5.3 - 2.1.0rc1 - see the filenames in URL. Place the downloaded file in your php extensions directory and open php.ini. Add the following line to the very end of the file (actually, doesn't matter where you place it):

;;                           ^^^^^^^^^^ change the path as in your system

I’d recommend you to put this and some other config properties under [xdebug] section:

;;                           ^^^^^^^^^^ change the path as in your system

Restart your web server, navigate to a file with phpinfo(); call and make sure if xdebug section is there. If it is not, go to step 2 and make sure you downloaded the version compatible with your php distribution and check the path to the .dll

3. Now we need DBGp notepad++ plugin. Here is its page: NOTE: I tried the latest version and it didn’t work with notepad++ 5.6.6, so I downloaded “DBGP Plugin v0.10 beta” – it worked for me. The installation is much easier than the one of xdebug – just copy the .dll to notepad++ plugins folder and restart the editor.

4. DBGp configuration. Launch notepad++, proceed to Plugins -> DBGp -> Config. You should see something like:

where Remote Server IP (is the ip of the server where your sources are, in my case it is, leave IDE KEY empty for now. This is the value of the GET parameter ?XDEBUG_SESSION_START=session_name if you want to start debug session explicitly. The other two fields are local and remote source folders. If you’re debugging locally, set both to the directory where your sources are. Check the first two options, this will refresh the variables watchlist on each step

5. Plugins -> DBGp -> Debugger You should see the debugger. Click on a red button to toggle a breakpoint. Refresh the page in your browser. If nothing happens with notepad++ and DBGp , try to append ?XDEBUG_SESSION_START=session_name to the address. You should see:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.