带有PHP7的Xdebug运行在带有nginx的Docker容器上的远程EC2实例上

我试图设置Xdebug来帮助我们的开发周期,但我有一些困难得到它的工作。 我也从来没有使用Xdebug,所以也许我误解了它的工作原理。

我们使用运行在Docker容器上的PHP7,前面有nginx。 这些Docker容器托pipe在EC2服务器上的专用VPC上。

我已经通过我的dockerfile安装了xdebug-2.5.4

RUN wget http://xdebug.org/files/xdebug-2.5.4.tgz && tar -xvzf xdebug- 2.5.4.tgz WORKDIR xdebug-2.5.4 RUN phpize RUN ./configure RUN make && cp modules/xdebug.so /usr/lib64/php/modules 

我已经确认它是通过检查我安装的php模块( php -m

我修改了我的PHP.ini:

 [xdebug] zend_extension = /usr/lib64/php/modules/xdebug.so xdebug.remote_autostart=on xdebug.remote_enable=on xdebug.remote_enable=1 xdebug.remote_handler="dbgp" xdebug.remote_host="<ip address of machine running docker>" xdebug.remote_port=9000 xdebug.remote_mode=req xdebug.remote_log="/tmp/xdebug.log" 

我已经将主机的PhpStorm首选项修改为xdebug.remote_hostxdebug.remote_port的相同IP地址和端口。

然而,我不知道从哪里继续下去。 值得注意的是,这不是运行PHP Web服务器,而是更多的是使用Postmantesting的RESTFUL API。 是否有可能使用xdebug这样的工作stream程?