XDebug, VSCode and Eclipse

enable in php.ini or xdegub.ini

XDebug 2

xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9003
XDebug 3
xdebug.mode = debug
xdebug.client_host = 127.0.0.1
xdebug.client_port = 9003
xdebug.start_with_request = yes
xdebug.discover_client_host = false

VSCode launch.json file under .vscode folder

"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
    "/var/www/webapps/<webapp folder>": "${workspaceFolder}"
}
Eclipse configuration
force to use ipv4 instead ipv6 editing file eclipse.ini and adding -Djava.net.preferIPv4Stack=true after -vmargs
In Eclipse use Default PHP Web Server
Window > Preferences > PHP > Debug > PHP Server = Default PHP Web Server
click on PHP Servers > Edit
Baseurl = http://localhost
Debugger = xdebug
Port = 9003 (change it also click on global settings)
remember to restart apache and php-fpm services
systemctl restart httpd
systemctl restart php-fpm
use firefox or chrome addons to enable debug on VSCode