We can see that in the configuration we've specified it to connect to the remote JVM using the 5005 port. So the above command starts our Docker container, and we can now configure remote debugging configuration to connect to it: In the JAVA_TOOL_OPTIONS we pass the value -agentlib:jdwp=transport=dt_shmem,address=,server=y,suspend=n to allow the Java process to start a JDB debug session and pass the value address=*:5005 to specify that 5005 will be our remote debugging port. We are using the -d extension for running docker in detached mode and -e for passing JAVA_TOOL_OPTIONS as an environment variable to the Java process. In general, there are two ways to run PHP from PhpStorm using Docker: 1. Apart from the normal HTTP port, which is 8080, we are also mapping an additional port, 5005, for remote debugging using the -p extension. Here docker-java-jar is our image name, and latest is its tag. Check your PHP (check phpinfo () output captured via browser) and see if it uses NTS or not. If PHP is used as Apache module, it must be Thread Safe one. ![]() PHP Xdebug requires this port to connect. 16.7k 4 36 41 asked at 21:31 Jacek Nowak 73 1 1 4 Use another Xdebug build - you are trying to use NTS build (Non Thread Safe), which is mainly for IIS. If we were using Java 11, we'd use this command instead: docker run -d -p 8080:8080 -p 5005:5005 -e JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,address=*:5005,server=y,suspend=n" docker-java-jar:latest Forward host port 9000 to Docker Toolbox machine: Your IDE/editor will open up port 9000 on your host operating system. Docker run -d -p 8080:8080 -p 5005:5005 -e JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n" docker-java-jar:latest
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |