Skip to content

Commit f1068ad

Browse files
authored
Merge pull request #233 from meirzamoodle/feature-xdebug-firewall-client-port
XDebug client_port
2 parents b9772c6 + 982beb6 commit f1068ad

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ read -r -d '' conf <<'EOF'
266266
; Settings for Xdebug Docker configuration
267267
xdebug.mode = debug
268268
xdebug.client_host = host.docker.internal
269+
; Some IDEs (eg PHPSTORM, VSCODE) may require configuring an IDE key, uncomment if needed
270+
; xdebug.idekey=MY_FAV_IDE_KEY
269271
EOF
270272
moodle-docker-compose exec webserver bash -c "echo '$conf' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
271273
@@ -274,7 +276,13 @@ moodle-docker-compose exec webserver docker-php-ext-enable xdebug
274276
moodle-docker-compose restart webserver
275277
```
276278

277-
While setting these XDebug settings depending on your local need, please take special care of the value of `xdebug.client_host` which is needed to connect from the container to the host. The given value `host.docker.internal` is a special DNS name for this purpose within Docker for Windows and Docker for Mac. If you are running on another Docker environment, you might want to try the value `localhost` instead or even set the hostname/IP of the host directly.
279+
While setting these XDebug settings depending on your local need, please take special care of the value of `xdebug.client_host` which is needed to connect from the container to the host. The given value `host.docker.internal` is a special DNS name for this purpose within Docker for Windows and Docker for Mac. If you are running on another Docker environment, you might want to try the value `localhost` instead or even set the hostname/IP of the host directly. Please turn off the firewall or open the port used in the `xdebug.client_port`.
280+
281+
Open the port (9003 is the default one) by using the example command for Linux Ubuntu:
282+
```
283+
sudo ufw allow 9003
284+
```
285+
278286

279287
After these commands, XDebug ist enabled and ready to be used in the webserver container.
280288
If you want to disable and re-enable XDebug during the lifetime of the webserver container, you can achieve this with these additional commands:

0 commit comments

Comments
 (0)