Skip to content

Instantly share code, notes, and snippets.

@matheusfaustino
Created December 9, 2017 11:17
Show Gist options
  • Save matheusfaustino/4ecadec710a8f2f89082abc573102169 to your computer and use it in GitHub Desktop.
Save matheusfaustino/4ecadec710a8f2f89082abc573102169 to your computer and use it in GitHub Desktop.
Basic config to use Xdebug in a docker container + phpstorm integration (as a server and as a cli).
# bash
# usage: xphp <php_file>
# xphp index.php
export PHP_IDE_CONFIG="serverName=<server_name_phpstorm>";
alias xphp='XDEBUG_CONFIG=\"idekey=PHPSTORM\" php -dxdebug.idekey=PHPSTORM -dxdebug.remote_host=172.17.0.1 -dxdebug.remote_port=9000 -dxdebug.default_enable=1 -dxdebug.remote_enable=1';
# xdebug config (Dockerfile)
RUN echo "\
xdebug.var_display_max_depth = 10\n \
xdebug.var_display_max_children = 256\n \
xdebug.var_display_max_data = 1024\n \
xdebug.default_enable=1\n \
xdebug.remote_enable=1\n \
xdebug.remote_host=172.17.0.1\n \
xdebug.remote_port=9000\n \
xdebug.idekey=PHPSTORM\n \
xdebug.profiler_output_dir=/application\n \
xdebug.profiler_enable_trigger=1\
" >> /etc/php/7.1/cli/conf.d/20-xdebug.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment