- create and start containers
$ docker-compose up -d
- composer install
$ docker exec -it slim bash $ composer install
- start local development server
$ php -S 0.0.0.0:80 -t public
-
install PHP Debug
-
setting
.vscode/launch.json
/.vscode/launch.json
{ "version": "0.2.0", "configurations": [ { "name": "Listen for Xdebug", "type": "php", "request": "launch", "port": 9003, "pathMappings": { "/var/www/html/": "${workspaceRoot}/src/public/" } }, ] }
Referens
launch.json attribute
https://code.visualstudio.com/docs/editor/debugging#_launchjson-attributes
about pathMappings
https://marketplace.visualstudio.com/items?itemName=xdebug.php-debug
/php.ini
https://xdebug.org/docs/all_settings
- Ctrl+Shift+D
- ▶︎(RUN) 「Listen for Xdebug」 selection
- Set a breakpoint on any line
- F5 or ▶︎ click to debag start