VSCode does not open page in browser

0

Next, I installed PHP Debug in VS Code as it teaches this site link , but when running, vs does not open the page in the browser. Does anyone know why?

laucher.json (I tried to use port 80 which is the one I use in wamp, anyway it 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
    
asked by anonymous 08.07.2018 / 22:21

2 answers

1

There is a "PHP Server" extension that starts a built-in PHP server, I think by default on port 3000. After installing the extension, Ctrl+Shift+P , shortcut to the Command Palette, search for PHP Server, a 'ps 'already results as a result depending on your extensions, and Enter. You will then open the file in the browser. You can also use the right mouse button and the PHP Server: Open file in Browser option.

Here's a great article showing step-by-step how to enable this extension and others for debugging PHP code:

link

    
21.11.2018 / 15:54
-2

Hello,

Manually process with VSCODE. Open the browser and type:

localhost/nomedapastadoseuprojeto

Another point is to check your use of frameworks that can have specific defined ports, for example the Angular that uses 4200 (at least here in my pc).

    
09.07.2018 / 17:16