Skip to content

Instantly share code, notes, and snippets.

@wellic
Last active May 12, 2017 12:21
Debuging console php application from docker container
#!/bin/sh
SERVER_NAME=localhost \
SERVER_PORT=80 \
XDEBUG_CONFIG="PHPSTORM" \
php -dxdebug.remote_host=`ip r | grep default | awk '/default/{print $3}'` \
$@
#Usage in the docker:
#c_xdebug.sh script.php
#
#Usage from the host:
#docker exec -it your_php_container bash -c 'cd to_src_dir; c_xdebug.sh script.php'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment