How to use XDebug with Laragon + VSCode

Recommended Posts

I love TracyDebugger, but today I had a hard time debugging some stuff and tried XDebug to get support for breakpoints. It was a quite straightforward setup:

  • create a file on your server and output phpinfo()
  • Copy the content of this page to the wizard:
  • DON'T follow the instructions there, it's simpler with laragon (choose your files and paths of course):
Download php_xdebug-2.6.0-7.1-vc14-x86_64.dll
Move the downloaded file to C:\laragon\bin\php\php-7.1.14-Win32-VC14-x64\ext
Enable xdebug via laragon


  • check if everything worked by visiting the phpinfo() page again - it should show a section about xdebug now
  • enable validaton in vscode by adjusting the user settings:
  "php.validate.enable": true,
  "php.validate.executablePath": "C:/laragon/bin/php/php-7.1.14-Win32-VC14-x64/php.exe",
  "": "onType",
  • install "PHP Debug" extension by Felix Becker and read the instructions
  • enable remote debugging by xdebug by adding this to your php.ini
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
  • create a testfile, eg home.php and set the debug config to "PHP"


  • add breakpoints and start debugging by pressing the green play icon


  • reload your page in the browser and the debugger will stop on lines 2 and 3 where we set the breakpoints. open vscode (if you don't have two screens) and follow code execution step by step.


There are also some videos on youtube:


If XDebug slows down your server you can simple enable/disable it via laragon. This will require only two clicks and reload apache automatically :)


  • Like 5
  • Thanks 1

Share this post

Link to post
Share on other sites
15 hours ago, bernhard said:

If anybody knows how to tackle this, please post the solution in the linked thread and I'll update this tutorial. Thanks

We did :).

  • Like 1

Share this post

Link to post
Share on other sites

Thx @FrancisChung and @kongondo, the quickest possible fix was to just copy laragon's php binary folder, rename it to php...-noXDebug and remove the .dll and comment out the section for xdebug in php.ini

You can enable/disable php extensions with a simple rightclick in laragon:

2018-04-27 13_00_49-.png

  • Like 2

Share this post

Link to post
Share on other sites
28 minutes ago, stand-ground said:


Could you please tell us what you mean by that?

  • Like 1

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.