Как настроить XDEBUG в VS CODE?

Добрый день.

Не получается настроить VS Code для работы с xdebug, тогда как Netbeans отрабатывает брякпоинты.
Конфигурация

Win 8.1 x64
VS Code 1.20.0 + PHP Debug 1.12.1
PHP 7.1.9
WAMP 3.1.0
php.ini
[xdebug]
; 2.6
zend_extension = "d:\wamp\bin\php\php7.1.9\zend_ext\php_xdebug-2.6.0-7.1-vc14-x86_64.dll"
; -not_working- zend_extension = "d:\wamp\bin\php\php7.1.9\zend_ext\php_xdebug-2.6.0-7.1-vc14.dll"
; -not_working- zend_extension = "d:\wamp\bin\php\php7.1.9\zend_ext\php_xdebug-2.6.0-7.1-vc14-nts.dll"
; -not_working- zend_extension = "d:\wamp\bin\php\php7.1.9\zend_ext\php_xdebug-2.6.0-7.1-vc14-nts-x86_64.dll"

xxdebug.remote_autostart = on
xdebug.remote_enable = on
xdebug.remote_host = 127.0.0.1
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_mode=req
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "d:\wamp\bin\php\php7.1.9\zend_ext"
xdebug.remote_log = "d:\wamp\bin\php\php7.1.9\zend_ext\xdebug.log"

launch.json
{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    // {
    //   "type": "chrome",
    //   "request": "attach",
    //   "name": "Attach to Chrome",
    //   "port": 9222,
    //   "webRoot": "${workspaceFolder}"
    // },
    {
      "name": "Listen for XDebug",
      "type": "php",
      "request": "launch",
      "port": 9000,
      "stopOnEntry": true,
      "log": true
    },
    {
      "name": "Launch currently open script",
      "type": "php",
      "request": "launch",
      "program": "${file}",
      "cwd": "${fileDirname}",
      "port": 9000
    }
  ]
}
index.php
<?php
$a = 1 + 1;
echo $a;
phpinfo();

Устанавливаю точки, давлю F5 в debug console падает:
spoiler

<- launchResponse
Response {
seq: 0,
type: 'response',
request_seq: 2,
command: 'launch',
success: true }

Точка в VS Code не срабатывает (IE11, Chrome), в отличии от Netbeans. Намучился второй день по конфигам лазить, помогите пожалуйста.
  • Вопрос задан
  • 1631 просмотр
Решения вопроса 1
@Dmi3ii Автор вопроса
Может кому пригодится:
--- настроить xDebug [php.ini]
zend_extension = "d:\wamp\bin\php\php7.1.9\zend_ext\php_xdebug-2.6.0-7.1-vc14-x86_64.dll"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"

--- VS CODE launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"hostname": "127.0.0.1",
"port": 9001
}
]
}
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы