php xdebug windows10 vscode xdebug behind company firewall to debug php files on remote linux server

Publicado em: 03 Agosto 2017
no canal de: emailform
1,589
4

Step 1: on AWS ubuntu linux, install and enable xdebug to php.ini

[xdebug]
zend_extension=xdebug.so
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_connect_back=on
xdebug.remote_port=9001
xdebug.remote_log=/home/raymond/xdebug.log
xdebug.remote_connect_back=1

Step 2: on AWS ubuntu linux, run php built-in web server

php -S localhost:8988 -t /home/raymond/www/webroot/ -c /etc/php5/cli/php-raymond.ini


Step 3: on windows 10, run vscode, and config php xDebug launch.json:

localSourceRoot and serverSourceRoot seems MUST be the same folder mapping, only add "c:" to the localSourceRoot

{
"version": "0.2.0",
"configurations": [

{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"localSourceRoot": "c:/home/raymond/www/webroot/",
"serverSourceRoot": "/home/raymond/www/webroot/",
"port": 9001
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
]
}

Step 4: on windows 10, config putty to use 2 port forwardings (2 tunnels) to ssh to AWS ubuntu linux server:

Config 2 port tunnels:

1) L8988, forward local 8988 to remote 8988

2) 4R9001, reverse remote port 9001to local 9001, FOR vscode, OTHERWISE php xdebug server can NOT connect vscode xdebug clicnt

Step 5: on windows 10, in vscode editor, set breakpoints, and run php xdebug


Nesta página do site você pode assistir ao vídeo on-line php xdebug windows10 vscode xdebug behind company firewall to debug php files on remote linux server duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário emailform 03 Agosto 2017, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 1,589 vezes e gostou 4 espectadores. Boa visualização!