Open panchalkalpesh opened 2 years ago
I have same problem with php 7.4, i solution was add lines in
RUN pecl install xdebug-2.8.0 \ && echo 'zend_extension='$(find /usr/local/lib/php/extensions/ -name xdebug.so)'\n\ xdebug.mode=debug\n\ xdebug.remote_enable=1\n\ xdebug.remote_host=host.docker.internal\n\ xdebug.remote_enable=1\n\ xdebug.remote_autostart=1' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ docker-php-ext-enable xdebug
in dockerfile from bin/php74 and folder config/php memory_limit = 1G post_max_size = 1G upload_max_filesize = 1G max_file_uploads = 500 max_execution_time=600 xdebug.remote_enable=1 xdebug.remote_host=127.0.0.1 xdebug.remote_port="9000" xdebug.remote_autostart=1 xdebug.remote_connect_back=1 xdebug.idekey = 'xDOCKERx' xdebug.var_display_max_depth = -1 xdebug.var_display_max_children = -1 xdebug.var_display_max_data = -1
in php.ini.
and you launch.json
"pathMappings": {
"/var/www/html/
}
maybe change sintax xdebug for xdebug 3
Hi, we just added new code and better documentation to the project regarding xdebug. Please let me know if your issue is still a thing, or if I can close this one :) Thank you
on php version 7.* the problem still persist on php 8 seems to work properly
I also have a problem with Xdebug. I tried on PHP74 and PHP8 - not work. Any advice?
I also have a problem with Xdebug. I tried on PHP74 and PHP8 - not work. Any advice?
Workaround - I jumped to the old commit 52defc2. With this version XDebug works.
The main issue with xdebug is in docker-compose file:
XDEBUG_CONFIG: "client_host=host.docker.internal remote_port=${XDEBUG_PORT}"
extra_hosts:
- "host.docker.internal:host-gateway"
host.docker.internal - it is docker gateway IP, but VSCODE server listens 9003 port on webserver - not on gateway.
To fix it you should:
docker-compose down
remove an image of webserver (e.g lamp82-webserver):
docker rmi -f id_your_webserver_image
Comment string XDEBUG_CONFIG: "client_host=host.docker.internal remote_port=${XDEBUG_PORT}" in docker-compose.yml
Change xdebug.client_host value in config/php/php.ini
xdebug.client_host=localhost
And rebuild stack:
docker-compose up -d
Describe the bug
Xdebug does not work when trying to debug the php application.
which Branch / PHP Version are you using ? php8
Steps to reproduce Steps to reproduce the behavior:
docker-composer up -d
Expected behavior If you set a breakpoint, the debugger should stop at execution.
Desktop (please complete the following information):
Additional context The problem will still persist even if the port 9003 is explicitly exposed through docker-compose.yml