I am using a Docker container running PHP 7.1 (php-fpm) and Nginx. I have installed and enabled Xdebug 2.5.0 (as image below shown).
I am trying to debug a single index.php file with this lines of code using "Zero Debug Configuration":
<?php
phpinfo();
But I am getting the following error:
Cannot accept external Xdebug connection: Cannot evaluate expression '$_SERVER['SERVER_PORT']'
I have search for similar issues and I have found this but nothing there helped me so far.
Here is the PhpStorm configuration related to Debug:
I am not sure what is failing here so I need some help around this. The repository with the Dockerfile and so on is here. I am using the following version of PhpStorm:
PhpStorm 2016.3.2 EAP
Build #PS-163.10154.2, built on December 13, 2016
JRE: 1.8.0_112-release-408-b2 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Can any give me some help? What I am missing on this setup?






$_SERVER['SERVER_PORT']shows in yourphpinfo()output (capture it via browser). P.S. Do not touch DBGp Proxy settings if you do not use them. - LazyOneSERVER_PORTvariable should be present in$_SERVERand port number should match the one you are using. - LazyOneDockerfileI am exposing the port9001then on thedocker-compose.ymlI am mapping the port from the container to the host as follow:9002:9001then as soon as I try to start a debug session in phpStorm I end up with this error:Can't start listening for connections from 'xdebug': Port 9002 is busy, why? What I miss here? - ReynierPMfastcgi_param SERVER_PORT $server_port;and that was causing the issue, it's working now, thanks - ReynierPM