Skip to content
Advertisement

VSCodium (VSCode) doesn’t start debugging PHP (PHP Debug + Xdebug, Linux)

Goal
Debug with PHP Debug, Xdebug and VSCodium.

Problem

VSCode doesn’t start debugging. When I click Start Debugging the blue line under the debugging control buttons appears and moves for a few seconds and then the control buttons disappear. Same when I press the green “Run” button

phpdebugvscode1

Also on the left side, where “variables”, “watch” and “stack” are shown nothing appears.

Description
I have no experience with the VSCodium debugging options. I used a couple of tutorials (1, 2, 3, videos and tried certainly the proposal from the VSCode PHP Debug extension site (which I use). I’m using Codium (VSCode without MS) on a Linux Mint 20 machine. PHP 7.4 and Xdebug are installed via Linux Synaptic Package Manager. Of course the Xdebug helper in Firefox is enabled, breakpoints are set and I tried it in different projects. I tried a few things in the php.ini. That’s how it looks at the moment:

JavaScript

Xdebug itself is loaded via the /etc/php/7.4/cli/conf.d/20-xdebug.ini and in PhpStorm it works like expected but not in VSCodium.

That’s the standard launch.json, which is saved in the .vscode folder in the project root:

JavaScript

Here is a part of my phpinfo() output:

phpinfo1

And the xdebug part:

enter image description here

enter image description here

And here the xdebug log when i try it with VSCodium:

JavaScript

My guess is, that there is a basic VSCodium debugging thing, I didn’t enabled or so. But I don’t know, what it could be. Maybe somebody has an idea?

Advertisement

Answer

Finally found the solution. Its a Codium specific bug. At VSCode it works. Found the solution here: https://github.com/VSCodium/vscodium/issues/466

  1. make sure you don’t have PHP Debug extension installed;

  2. go to https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug and download vsix file using “Resources” → “Download Extension”;

  3. in VSCodium go to “Extensions” sidebar and then click three dots icon near to “Extensions” title;

  4. choose “Install from VSIX…” and select downloaded file.

@LazyOne thanks for your help again 🙂

Edit:

If you are updated to Xdebug 3.* you have to modify the xdebug section in the php.ini:

Add this:

JavaScript

You could drop the last line if you change instead the port to 9003 in your launch.json.

See also this GitHub Issue

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement