Xdebug V3 Doesn't Stop Breakpoints in VScode

Xdebug V3 doesn't stop breakpoints in VSCode

You are using Xdebug v3 but keep using Xdebug v2 config parameters. You need to go through Upgrading from Xdebug 2 to 3 Guide and adjust your settings.

Xdebug v3 uses different config params than Xdebug v2 (your phpinfo() output tells you exactly that on your screenshot). 5 out of 6 "xdebug." params from your current php.ini do nothing in Xdebug v3.

For Xdebug 3 it should be like this (based on your original config -- better start using new 9003 default port):

zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
xdebug.client_host = "127.0.0.1"
xdebug.log = "C:\xampp\tmp\xdebug\xdebug.log"
xdebug.idekey = VSCODE

Xdebug 3 doesn't stop on breakpoints

You don't say which of your three configurations you're using, but if you're using first the "Listen for Xdebug" one, then Xdebug won't attempt anything because you have xdebug.start_with_request = no in php.ini.

Set it to either trigger and use a browser extension, or yes to have Xdebug always initiate the request. Please refer to the documentation for more information.

The log is empty, because Xdebug never even attempted to make a connection to the VS Code plugin.

VSCode with Xdebug doesn't stop at breakpoint

I fixed my problem as followed:

  1. I set the Apache server to another port that is not: 9000 or 9003

  2. After reading the link i understood that a lot of settings where V2. So i changed the xdebug setting to only:

    xdebug.remote_autostart = yes
    xdebug.mode = debug
    zend_extension = C:\xampp\php\ext\php_xdebug-3.0.3-8.0-vs16-x86_64.dll

https://xdebug.org/docs/upgrade_guide


  1. in visual studio code I changed the launch.json port to 9003 (which is the default port in Xdebug)

It worked perfectly! Thank you LazyOne!

Xdebug in VSCode does not stop on breakpoint for Laravel artisan commands from command line

Finally with the help of @LazyOne I could figure this out.

The root cause of the problem was that due to a macOS update my terminal in VSCODE was replaced with a new terminal, zsh.

This terminal did not have the right php path/version configured, therefore when I ran the artisan commands from the command line, I run it with the default php version without Xdebug installed.

When I changed the path to the php version installed under my MAMP package, it just worked. To make this more convenient, I added an alias to the zsh configuration file pointing to the right php version.

Visual Studio Code won't stop at breakpoint in PHP Xdebug

Finally i know the source of problem. The HP Elitebook have preinstalled program named HP Velocity, which used port 9000.

The issue is port 9000 from my host is bind to port 9000 of HP Velocity software. When HP Velocity service connect to the localhost xdebug server, logs say that connection is ok, but it is connected to HP Velocity.

I changed xdebug port to 9090 in php.ini and changed in launch.json on visual studio code. After that, my visual studio code work as usual and can stop at breakpoint.

Hope this help others :)



Related Topics



Leave a reply



Submit