I am trying to set up Xdebug on my Docker build but it's not working as I expect. I added RUN docker-php-ext-enable xdebug to my Dockerfile, I have added following xdebug.ini and mapped it to /usr/local/etc/php/conf.d/:
[xdebug]
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM
xdebug.profiler_enable=0
xdebug.max_nesting_level=700
xdebug.remote_autostart=off
xdebug.remote_host=192.168.0.1 # your ip
xdebug.remote_port=9001
xdebug.remote_connect_back=1
; with sane limits
html_errors = On
xdebug.default_enable=1
xdebug.var_display_max_depth = 5
xdebug.var_display_max_children = 256
xdebug.var_display_max_data = 1024
Also, when I try to add RUN pecl install xdebug I end up with error:
Step 26/31 : RUN pecl install xdebug
---> Running in e8ab055ec4a9
pecl/xdebug is already installed and is the same as the released version 2.5.5
install failed
ERROR: Service 'web' failed to build: The command '/bin/sh -c pecl install xdebug' returned a non-zero code: 1
Also, I verified there is a proper extension on my container environment once I build it (without this pecl install):
root@9763fbd22b39:/app# find /usr/local/lib/php/extensions/ -name xdebug.so
/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
I also added following line to my Dockerfile:
RUN echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini
And yet, when I run phpinfo() the only occurrence of xdebug I see is
What am I missing?
