Open stefnats opened 3 years ago
Same issue with the default preconfig image of PHP
devcontainer.json
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.3/containers/php
{
"name": "PHP",
"build": {
"dockerfile": "Dockerfile",
},
"settings": {
"php.validate.executablePath": "/usr/local/bin/php"
},
"extensions": [
"felixfbecker.php-debug",
"bmewburn.vscode-intelephense-client",
"mrmlnc.vscode-apache"
],
"forwardPorts": [8080],
"remoteUser": "vscode"
}
Dockerfile
ARG VARIANT="7.4"
FROM mcr.microsoft.com/vscode/devcontainers/php:0-${VARIANT}
This is normal when not debugging the application. By default xdebug listens for a "debugging" connection. If you are not debugging, then it displays the warning that you are seeing. When you try running your application with F5 (debugging mode) then you will not see that message.
@mabasic , I try to F5 to debug. I can see the server is running in remote container localhost:9003
and I try to browse the page in local localhost:9003
, but there is no response.
I also try in terminal with telnet localhost 9003
in local and there is no connection as well.
When you start debugging in vs code, you should open the browser to the port on which your application is running, not the port of the debugger.
Set a breakpoint in vscode, make a request to your application so that the breakpoint is triggered and you will see that the application execution is paused and that you can see the current variables in vsvode.
@mabasic , I try your suggestion. when you run F5 and enter the debugging mode, you can see your runing process is on the port 9003. I try to browse both port 8080 and 9003, but I cannot reach both of them. You can see the ports from the ports tab of VSCODE terminal panel below:
See the readme for debugging instructions. I think that you need to start the server first.
@mabasic , Thanks. I manage to solve the issue. It turns out that I use the default launch.json from VScode and it doesn' work. I try to copy the launch.json of the repo and it works fine.
Hello,
i'm using this container with the following config (
devcontainer.json
):When i run any php process i receive this error
Dockerfile
is still as is: https://github.com/microsoft/vscode-remote-try-php/blob/67e233b925a64f90a46092879ed82b9e6d89f19e/.devcontainer/DockerfileAm i doing something wrong? Thanks in advance!