T
T
teodor7teodor72021-07-01 09:13:13
PHP
teodor7teodor7, 2021-07-01 09:13:13

How to make Xdebug + vscode + linux work for Yii2 console debugging?

When I run console scripts Yii2 gives an error

Cannot evaluate code without a connection

php 7.2
xdebug 3.0
yii2
launch.js
{
    // 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": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "cwd": "${workspaceFolder}",
            "port": 9003
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${workspaceFolder}",
            "port": 9003
        }
    ]
}

php.ini

xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.remote_enable=1
xdebug.client_host=localhost

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question