File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,7 +3,20 @@ Flip between non xdebug local dev (much fast) to xdebug local dev (not fast but
33
44Setup
55
6+ Full guide available at https://strayobject.medium.com/php-docker-and-xdebug-v3-with-no-performance-loss-9d0f49ac53ba
7+
681 . Create a docker network:
79` docker network create --subnet=192.168.50.0/24 pxd-docker `
8102 . Add ` 127.0.0.1 php-xdebug-docker ` to your hosts file.
9113 . Run ` docker-compose up -d ` to start the env
12+ 4 . Open index.php in editor and add a breakpoint on line 6
13+ 5 . Open your browser, set up the plugin from the list: https://www.jetbrains.com/help/phpstorm/browser-debugging-extensions.html
14+ 6 . In browser navigate to http://php-xdebug-docker and turn on the extension.
15+ 7 . Reload the page (breakpoint should be triggered in the code editor)
16+
17+ Note: To see the breakpoint triggered via cli, you need to execute your commands in the app_xdebug container.
18+
19+ ` docker-compose exec app_xdebug php index.php `
20+
21+
22+ Enjoy!
Original file line number Diff line number Diff line change 11PHP_XDEBUG_ENABLED = 1
2- PHP_XDEBUG_REMOTE_PORT = 9002
2+ # PHP_XDEBUG_REMOTE_PORT=9002
33# Xdebug remote host likely 192.168.50.1 if on linux, use host.docker.internal on a Mac
44PHP_XDEBUG_REMOTE_HOST = 192.168.50.1
55PHP_XDEBUG_IDKEY = pxd
66PHP_MEMORY_LIMIT = 1G
77
8- APP_ENV = dev
98PHP_IDE_CONFIG = " serverName=pxd"
Original file line number Diff line number Diff line change 1- FROM php:7.3 -fpm
1+ FROM php:7.4 -fpm
22
33ARG USER_ID
44ARG GROUP_ID
Original file line number Diff line number Diff line change 1- FROM php:7.3 -fpm
1+ FROM php:7.4 -fpm
22
33ARG USER_ID
44ARG GROUP_ID
Original file line number Diff line number Diff line change 22xdebug.default_enable =${PHP_XDEBUG_ENABLED}
33xdebug.max_nesting_level =256
44
5- xdebug.remote_enable =1
6- xdebug.remote_autostart =1
7- xdebug.remote_host =${PHP_XDEBUG_REMOTE_HOST}
8- xdebug.remote_port =${PHP_XDEBUG_REMOTE_PORT}
5+ xdebug.start_with_request =yes
6+ xdebug.mode =debug
97xdebug.idekey =${PHP_XDEBUG_IDKEY}
8+ xdebug.client_host =${PHP_XDEBUG_REMOTE_HOST}
9+ # xdebug.client_port=${PHP_XDEBUG_REMOTE_PORT}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ resolver 127.0.0.11;
44# idea from https://github.com/developersalliance/magento2-dockergento/blob/master/config/dockergento/nginx/conf/default.conf
55map $cookie_XDEBUG_SESSION $fastcgi_pass {
66 default app;
7- wordpress app_xdebug;
7+ pxd app_xdebug;
88}
99
1010server {
You can’t perform that action at this time.
0 commit comments