Skip to content

Commit 720e619

Browse files
author
Alcides Ramos
committed
docs: Updated README.md
Improved xDebug section
1 parent 3e30eba commit 720e619

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ welcome:
118118

119119
.PHONY: help
120120
help: ensure_gum_is_installed welcome
121-
$(eval OPTION=$(shell gum choose --height 20 --header "Choose a command..." --selected "exit" "exit" "set-environment" "build" "up" "down" "restart" "logs" "inspect" "shell" "composer-dump" "composer-install" "composer-update" "composer-require" "composer-require-dev" "check-syntax" "check-style" "fix-style" "phpstan" "test" "coverage" "install-caddy-certificate" "install-skeleton" "install-laravel" "install-symfony" "uninstall-app" "open-website"))
121+
$(eval OPTION=$(shell gum choose --height 20 --header "Choose a command..." --selected "exit" "exit" "set-environment" "build" "up" "down" "restart" "logs" "inspect" "shell" "composer-dump" "composer-install" "composer-update" "composer-require" "composer-require-dev" "get-xdebug-client-host" "check-syntax" "check-style" "fix-style" "phpstan" "test" "coverage" "install-caddy-certificate" "install-skeleton" "install-laravel" "install-symfony" "uninstall-app" "open-website"))
122122
@$(MAKE) ${OPTION}
123123

124124
###
@@ -213,6 +213,16 @@ composer-require-dev:
213213
@$(DOCKER_RUN_AS_USER) composer require --dev
214214
$(call taskDone)
215215

216+
###
217+
# DEBUG
218+
###
219+
220+
.PHONY: get-xdebug-client-host
221+
get-xdebug-client-host:
222+
$(call showInfo,"Inspecting [ $(SERVICE_APP) ] networks settings...")
223+
@docker inspect --format "{{json .NetworkSettings.Networks.docker_default.Gateway}}" $(SERVICE_APP) | jq -r
224+
$(call taskDone)
225+
216226
###
217227
# APP / QA RELATED
218228
###

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,31 @@ $ make down
475475

476476
### Debug / Setup PHPStorm
477477

478+
#### Docker-Compose Environment
479+
480+
Please update the `docker-compose.override.dev.yml` file with proper `PHP_XDEBUG_CLIENT_HOST` IP address. You can get this value just by executing the following command:
481+
482+
```bash
483+
$ make get-xdebug-client-host
484+
```
485+
486+
So the `docker-compose.override.dev.yml` should look like:
487+
488+
```yaml
489+
environment:
490+
- PHP_XDEBUG_IDEKEY=PHPSTORM
491+
- PHP_XDEBUG_MODE=develop,coverage,debug,profile
492+
- PHP_XDEBUG_START_WITH_REQUEST=yes
493+
- PHP_XDEBUG_CLIENT_HOST=172.18.0.1
494+
- PHP_XDEBUG_CLIENT_PORT=9003
495+
- PHP_XDEBUG_MAX_NESTING_LEVEL=3000
496+
- PHP_XDEBUG_OUTPUT_DIR=/tmp/xdebug
497+
- PHP_XDEBUG_DISCOVER_CLIENT_HOST=false
498+
- PHP_XDEBUG_LOG=/dev/stdout
499+
- PHP_XDEBUG_LOG_LEVEL=0
500+
...
501+
```
502+
478503
#### Help > Change Memory Settings
479504

480505
To allow PHPStorm index huge projects consider to increase the default assigned memory amount from 2048 MiB up to 8192 MiB.

0 commit comments

Comments
 (0)