Skip to content

Instantly share code, notes, and snippets.

@gaambo
Created August 24, 2021 12:02
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 gaambo/9a7c04af2ea0dda35bb5ba687b3a9081 to your computer and use it in GitHub Desktop.
Save gaambo/9a7c04af2ea0dda35bb5ba687b3a9081 to your computer and use it in GitHub Desktop.
WordPress Core Developing with Xdebug + VSCode + WSL 2
##
# The PHPUnit container.
##
phpunit:
build:
context: ./tools/local-env
dockerfile: Dockerfile-phpunit
FROM wordpressdevelop/phpunit:${LOCAL_PHPUNIT:-latest}
# install xdebug
RUN pecl install -f xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini;
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"hostname": "localhost",
"pathMappings": {
"/var/www": "${workspaceRoot}"
},
"xdebugSettings": {
"max_data": -1
}
}
]
}
xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.client_port=9000
xdebug.discover_client_host=true
xdebug.start_with_request=yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment