1

I'm trying to set up Xdebug with VScode, but whenever I set breakpoints it's just ignoring it.

I installed https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug and followed the instructions (Windows), I also used the Xdebug Wizard, here is my configuration :

Vscode - launch.json

{
  "name": "Listen for XDebug",
  "type": "php",
  "request": "launch",
  "port": 9000
},
{
  "name": "Launch currently open script",
  "type": "php",
  "request": "launch",
  "program": "${file}",
  "cwd": "${fileDirname}",
  "port": 9000
}

php.ini

zend_extension = D:\wamp\bin\php\php7.1.16\ext\php_xdebug-2.6.1-7.1-vc14.dll

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_log=D:\wamp\logs\xdebug.log

Note: I can't find any logs, I probably didn't set it correclty but I don't know how to make it work either

php -v

$ php -v
PHP 7.1.16 (cli) (built: Mar 28 2018 21:27:36) ( ZTS MSVC14 (Visual C++ 2015) x8
6 )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.6.1, Copyright (c) 2002-2018, by Derick Rethans

Thank you for reading !

1 Answer 1

7

I believe you may need the following in your php.ini:

xdebug.remote_connect_back=1

See the xdebug.ini for WPLib Box’s PHP container which definitely works with XDEBUG and VS Code.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.