0
Next, I installed PHP Debug in VS Code just like this site teaches https://imasters.com.br/back-end/configurando-debugger-php-no-vs-code, however, when running vs does not open the page in the browser. Someone knows why?
Laucher.json (I tested using port 80 which is the q I use in wamp, even so will not).
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9000
}
php.ini (this was added when adding the Debug extension)
xdebug.remote_enable = off
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="c:/wamp64/tmp"
xdebug.show_local_vars=0
zend_extension = \php_xdebug-2.6.0-7.2-vc15-x86_64.dll // esse arquivo está na mesma pasta do php.ini
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
The article is to use Xdebug to debug the script directly on the Vscode console, if understood, open the browser is something complicated, Apache uses virtual and non-physical routes, of course it should be possible to point a file to open "with HTTP", but if it will depend a lot on configuring Apache (Wamp, xampp, easyphp all use apache, which is the http server, PHP is only the script interpreter, despite having a built-in mini server). Example when using a route framework even if Vscode opened the browser would not understand well the routes, as Laravel, because the paths are not physical.
– Guilherme Nascimento
If you are just open in the browser you can use some extension type a Live Server that can solve.
– hugocsl
William, I usually use wamp with netbeans, and it opens, do you think it might be something with Vscode? (I’m wanting to use VS because it’s lighter than netbeans).
– Leandro