https://github.com/tyhopp/php-xdebug-docker
Docker/WSL2/VSCode/XDebug breakpoint reproduction
https://github.com/tyhopp/php-xdebug-docker
Last synced: 11 months ago
JSON representation
Docker/WSL2/VSCode/XDebug breakpoint reproduction
- Host: GitHub
- URL: https://github.com/tyhopp/php-xdebug-docker
- Owner: tyhopp
- Created: 2024-01-16T01:51:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-16T01:53:19.000Z (over 2 years ago)
- Last Synced: 2025-05-16T06:08:50.899Z (about 1 year ago)
- Language: PHP
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker/WSL2/VSCode/XDebug breakpoint reproduction
If `"hostname": "0.0.0.0"` is not set in the VSCode launch configuration, breakpoints are not hit.
## Usage
1. Build with `docker build -t php-xdebug-docker .`
2. Run in interactive mode with `docker run -it -p 9003:9003 php-xdebug-docker /bin/bash`
3. Run XDebug launch script in VSCode that looks like this:
```json
{
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"port": 9003,
"pathMappings": {
"/tmp": "${workspaceFolder}"
},
"log": true
}
]
}
```
4. Set a breakpoint in `index.php`
5. From the bash terminal in the container, execute the PHP script with `php /tmp/index.php`
6. See that breakpoints set in `index.php` are not hit