Skip to content

Instantly share code, notes, and snippets.

@alairock
Created February 14, 2017 17:08
Show Gist options
  • Save alairock/913882da00a6d2b6620be1ec23c3c54c to your computer and use it in GitHub Desktop.
Save alairock/913882da00a6d2b6620be1ec23c3c54c to your computer and use it in GitHub Desktop.
Docker debug php
#! /bin/bash
HOST_IP=`/sbin/ip route | awk '/default/ { print $3 }'`
sudo apt update
sudo apt install php-xdebug
echo "zend_extension=/usr/lib/php/20131226/xdebug.so" > /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_handler=dbgp" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_mode=req" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.var_display_max_data = 2048" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.var_display_max_depth = 128" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.max_nesting_level = 500" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.idekey = phpstorm-xdebug" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.default_enable = 0" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_enable = 1" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_autostart = 1" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_connect_back = 0" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.profiler_enable = 0" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_port = 9905" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
echo "xdebug.remote_host = 192.168.1.199" >> /etc/php/5.6/fpm/conf.d/20-xdebug.ini
pkill php-fpm5.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment