<!-- Morning -->
Docker PHP Debug
- To debug a PHP script in PhpStorm you need first to install and configure the
php-xdebug
extension in the container:
[xdebug]
xdebug.mode=debug
xdebug.start_upon_error=yes
xdebug.client_host=host.docker.internal
xdebug.client_port=9003
xdebug.log=/var/log/php-xdebug.log
- Then set the PHP interpreter and external server in the PhpStorm, you can
follow:
Debug with PhpStorm: Ultimate Guide
- Finally and the most important to make script debugging work, export the
environment value
PHP_IDE_CONFIG=serverName=<server_name>
(for example in
the docker-compose.yaml
)
<!-- What do I want to do today? -->
<!-- Evening -->
<!-- What did I learn today? -->
<!-- Things I learned -->
<!-- Useful tools and libraries -->