Skip to content

Instantly share code, notes, and snippets.

@afragen
Last active December 20, 2023 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afragen/a10d0475b71bfb79745df52ed3300924 to your computer and use it in GitHub Desktop.
Save afragen/a10d0475b71bfb79745df52ed3300924 to your computer and use it in GitHub Desktop.
My setup for wordpress-develop Docker wp environment on Apple Silicon with xDebug active

These are the files needed for setting up the Docker wp environment for wordpress-develop with xDebug active on Apple Silicon. Currently Docker wp runs

  • PHP 7.4.33
  • xDebug 3.1.6

I created and placed the custom-php-config.ini file one level above wordpress-develop.

The docker-compose.override.yml is at the root level of wordpress-develop.

Then simply follow the instructions in the https://github.com/WordPress/wordpress-develop/blob/trunk/README.md

The launch.json is for VSCode. Mine is set in my settings.json so it is available in all the time. The launch.json contains all the settings I have and use depending on the WordPress installation and the xDebug version installed.

Thanks @costdev for the help.

You will need to env:stop and env:reset if switching between different clones. Only one may be active at a time and must be removed before starting a new one.

display_errors = On
error_reporting = -1
upload_max_filesize = 1G
post_max_size = 1G
xdebug.mode=debug,develop
xdebug.log_level=0
xdebug.start_with_request=yes
xdebug.discover_client_host=yes
xdebug.client_host=host.docker.internal
services:
mysql:
image: ${LOCAL_DB_TYPE-mysql}:8.0
platform: linux/arm64
php:
platform: linux/amd64
environment:
- LOCAL_PHP_XDEBUG=true
volumes:
- ../custom-php-config.ini:/usr/local/etc/php/conf.d/php-config.ini
- ./:/var/www
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug 3.x - Docker",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/var/www": "${workspaceFolder}"
},
"xdebugSettings": {
"max_children": 128,
"max_depth": 3,
"max_data": 1024,
"show_hidden": 1
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment