Trying to debug PHP from IntelliJ on Windows 10.
These are the first lines in my Dockerfile:
FROM drupaldocker/php:7.1-apache
# Install xdebug
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
I tried copying and pasting configuration from several sources, e.g.:
&& echo "error_reporting = E_ALL" > /usr/local/etc/php/php.ini \
&& echo "display_startup_errors = On" >> /usr/local/etc/php/php.ini \
&& echo "display_errors = On" >> /usr/local/etc/php/php.ini \
&& echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.idekey=\"PHPSTORM\"" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_port=9000" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_connect_back=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
The result is always the same.
I start the container via docker-compose and map port 9000 to localhost:9000 using the following line in compose yml.
ports:
- "9000:9000"
When I try to start listening from IntelliJ I get the error: Port 9000 is busy.
I tried telnet 127.0.0.1 9000
I get the message: connection closed by foreign host.
Any idea what could be wrong?