Last active
March 30, 2026 08:33
-
-
Save glasket/0657229582a94663629616ae21e3b893 to your computer and use it in GitHub Desktop.
Files needed to configure xdebug to work with VSCode, WSL2, and Docker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This can be any init/rc style file, or you can execute it manually | |
| export IP=$(hostname -I) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.8' | |
| services: | |
| web: | |
| build: .docker/web | |
| volumes: | |
| - .:/var/www/html | |
| ports: | |
| - 80:80 | |
| extra_hosts: | |
| - "docker.host:${IP}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM php:7.4-apache | |
| # This image makes use of php-extension-installer in order to simplify the installation of multiple extensions | |
| ADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/install-php-extensions /usr/local/bin/ | |
| RUN chmod uga+x /usr/local/bin/install-php-extensions && sync && \ | |
| install-php-extensions calendar exif ffi gd gettext pcntl pdo_pgsql pgsql shmop sockets sysvmsg sysvsem sysvshm xsl xdebug | |
| COPY remote-php-debug.ini $PHP_INI_DIR/conf.d/remote-php-debug.ini |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Listen for XDebug", | |
| "type": "php", | |
| "request": "launch", | |
| "port": 9000, | |
| "pathMappings": {"/var/www/html": "${workspaceRoot}"} | |
| }, | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| xdebug.remote_enable = 1 | |
| xdebug.remote_autostart = 1 | |
| xdebug.remote_connect_back = 0 | |
| xdebug.remote_host = docker.host | |
| xdebug.remote_port = 9000 | |
| xdebug.idekey = VSCODE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment