lobivideo.blogg.se

Phpstorm docker xdebug
Phpstorm docker xdebug









  1. #Phpstorm docker xdebug manual
  2. #Phpstorm docker xdebug code

The IP of the machine where the IDE is located is unknown/team developmentīecause the IDE's IP is unknown or there are multiple IDEs, Xdebug cannot predict the target IP of DBGP interaction in advance.

phpstorm docker xdebug

In the figure, because the IDE's IP and listening port are known, the Xdebug side can clearly know the IDE target machine information during DBGP interaction, so Xdebug only needs to configure xdebug.remote_host and xdebug.remote_port. The IP of the machine where the IDE is located/single-person development

#Phpstorm docker xdebug manual

In the end what happened?įirst of all, in order to understand the interaction process between Xdebug and PhpStorm, I checked the official manual and learned that when Xdebug works in remote debugging mode, there are two working methods:ġ. To be sure, Xdebug is trying to create a TCP link to the target machine with IP 172.17.0.1 and port 9001, instead of the correct local IP of 192.168.1.101. Looking back at the error log of Xdebug, pay attention to the link information when the failure is observed: tcp I: Remote address found, connecting to 172.17.0.1:9001.Īt this time, the data packets intercepted by tcpdump in the container are as follows: $ tcpdump -nnA port 9001ġ2:20:34.318080 IP 172.17.0 > 172.17.: Flags, seq 2365657644, win 29200, options, length 0Į. It means that it is normal to create a TCP link between the container and the local 9001, but why does Xdebug report the link failure? At this point, at least it can be ruled out that the problem will not be due to the PhpStorm side configuration. Port 9001 is listening normally, and then use telnet in the container to try to create a TCP link with the local port 9001: phpstorm $ telnet 192.168.1.101 9001 Check the local 9001 portĮxecute netstat -ant command under Win : network 协议 本地地址 外部地址 状态 卸载状态 Looking at these problem expressions, you can basically locate a network communication problem between Xdebug and PhpStorm, and then locate the specific problem step by step. W: Creating socket for '172.17.0.1:9001', poll success, but error: Operation now in progress (29).Į: Could not connect to client. I: Checking header 'HTTP_X_FORWARDED_FOR'. Then check the Xdebug debug log xdebug.log, there is the following error: docker I: Checking remote connect back address. First, observe the status of PhpStorm's Debug console: github Waiting for incoming connection with ide key *** Start collecting detailed statements of the problem. Problem DescriptionĪfter installing and configuring Xdebug in Docker, and setting the corresponding Debug parameters in PhpStorm, Debug does not work normally.Īt this point, php.ini the Xdebug configuration is as follows: git xdebug.idekey = phpstorm In this situation, Xdebug belongs to the remote debugging mode, the IDE and local IP are 192.168.1.101, and the LNMP container IP in Docker is 172.17.0.2. Note: The development and debugging environment is LNMP in the local Docker, and the IDE environment is PhpStorm under the local Win10. Here are the methods and precautions for using Xdebug in Docker. After the blogger moved the development environment to Docker, Xdebug debugging encountered some problems.

#Phpstorm docker xdebug code

We often use PhpStorm combined with Xdebug for code breakpoint debugging, so that we can track the program execution process, facilitate code debugging and find potential problems.











Phpstorm docker xdebug