I'm trying to setup Xdebug to help our development cycle but I'm having some difficulty getting it working. I've also never used Xdebug before so maybe I'm misunderstanding how it works.
We're using PHP7 running on Docker containers with nginx in front of it. These Docker containers are hosted on a private VPC on EC2 servers.
I've installed xdebug-2.5.4 through my dockerfile
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
I've confirmed that it's installed by checking my installed php modules (php -m
)
I've modified my 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"
I've modified my PhpStorm preferences with the host as the same IP address and port in xdebug.remote_host
and xdebug.remote_port
.
However, I'm at a loss as to where to continue from here. It's worth noting that this isn't running a PHP Web Server, but more of a RESTFUL API that we test using Postman. Is it even possible to use xdebug with such a workflow?