Running a script.php from command line I do like this
$ php -f myscript.php
I can follow the process with die()
and print_r()
. But I can't connect with my IDE (IntelliJ) like a regular xdebug session comming from the Browser.
I am running inside a MacOS(HOST) connected with a docker ubuntu 16.04.
The IntelliJ is configured to listen incoming call from Docker. I think when I use my terminal I am using the php from my host and this is why the IntelliJ is not catching the connection.
Even when I run from the terminal inside the Docker container, the xdebug process in IntelliJ is not trigged.
Note: The xdebug is working good with the Docker and IntelliJ in a regular Browser session. I just pass the HOST IP when building the container and it works.
This is the portion of my Dockefile that set the xdebug:
RUN { \
echo '[xdebug]'; \
echo 'zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so'; \
echo 'xdebug.remote_enable=1'; \
echo 'xdebug.remote_port=9000'; \
echo 'xdebug.remote_autostart=1'; \
echo 'xdebug.remote_handler=dbgp'; \
echo 'xdebug.idekey=dockerdebug'; \
echo 'xdebug.profiler_output_dir="/var/www/html"'; \
echo 'xdebug.remote_connect_back=0'; \
echo 'xdebug.remote_host=$REMOTE_HOST'; \
} >> /usr/local/etc/php/php.ini
How could I achieve this debug process?