Xdebug doesn't work

Hi all. As in the title, I’m trying to setting up a debug environment with Xdebug. Precisely, on this machine I’ve VSCode, nginx and php-fpm installed.

To start, I’ve installed php7-xdebug and i’ve modified /etc/php7/cli/php.ini and /etc/php7/conf.d/php.ini adding:


zend_extension="/usr/lib64/php7/extensions/xdebug.so
xdebug.remote_autorestart=1
xdebug.remote_autostart=1
xdebug.remote_log=/var/log/xdebug.log
xdebug.remote_port = 9009
xdebug.idekey = VSCODE

In VSCode, i’ve insalled PHP debug extension, opened my web folder (the one i use for www files) and created a configuration json as


{
    // 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",
            "port": 9009
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        }
    ]
}

Then sudo systemctl start nginx, sudo systemctl start php-fpm, putted breakpoints in the sample code. After that, I’ve selected Lisen for XDebug on the left and pressed play. Nothing happen, only the bottom bar of vscode become red, no messages, no writes anywhere (i can see).
If i try to write something in the debug-console, the answer is Cannot evaluate code without a connection.

Anyone can help me with the configuration?