Skip to content

Instantly share code, notes, and snippets.

@robertov8
Created January 1, 2017 20:36
Show Gist options
  • Save robertov8/992aae51523156e4b13f7dc6cf384e78 to your computer and use it in GitHub Desktop.
Save robertov8/992aae51523156e4b13f7dc6cf384e78 to your computer and use it in GitHub Desktop.
Php Xdebug - Vagrant - Wocker

Php Xdebug - Vagrant - Wocker

Vagrant

Into the VM

vagrant ssh

Run an interactive shell in your Container

docker exec -it $(docker ps -q) bash

Docker

apt-get update

Keep the local version currently installed

apt-get install php5-dev -y

pecl install xdebug

Scan for additional .ini files in: /etc/php5/cli/conf.d

php --ini | grep 'Scan for additional'

touch /etc/php5/cli/conf.d/30-xdebug.ini

echo "zend_extension=/usr/lib/php5/20131226/xdebug.so
xdebug.overload_var_dump = 1
xdebug.var_disply_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = 512
xdebug.max_nesting_level = -1
xdebug.collect_params = 4
xdebug.profiler_enable_trigger = 1
xdebug.profiler_enable = 0
xdebug.remote_enable = 1
xdebug.remote_connect_back = on
xdebug.remote_host = wocker.dev
xdebug.profiler_output_dir = \"/tmp\"
xdebug.profiler_output_name = \"cachegrind.out.%t-%s\"" > /etc/php5/apache2/conf.d/20-xdebug.ini

service apache2 restart

php -v

php -m

Remove packages

apt-get remove \
autoconf automake autopoint autotools-dev binutils bsdmainutils build-essential bzip2 cpp \
cpp-4.9 debhelper dh-php5 dpkg-dev fakeroot file g++ g++-4.9 gcc gcc-4.9 gettext \
gettext-base groff-base intltool-debian libalgorithm-diff-perl libalgorithm-diff-xs-perl \
libalgorithm-merge-perl libasan1 libasprintf-dev libasprintf0c2 libatomic1 libc-dev-bin \
libc6-dev libcilkrts5 libcloog-isl4 libcroco3 libdpkg-perl libfakeroot \
libfile-fcntllock-perl libgcc-4.9-dev libgettextpo-dev libgettextpo0 libglib2.0-0 libglib2.0-data \
libgomp1 libisl10 libitm1 liblsan0 libltdl-dev libltdl7 libmail-sendmail-perl libmpc3 libmpfr4 \
libpcre3-dev libpcrecpp0 libpipeline1 libquadmath0 libsigsegv2 libssl-dev libssl-doc \
libstdc++-4.9-dev libsys-hostname-long-perl libtimedate-perl libtool libtsan0 libubsan0 \
libunistring0 linux-libc-dev m4 make man-db manpages manpages-dev patch php-pear \
php5-dev pkg-php-tools po-debconf shared-mime-info shtool xdg-user-dirs xz-utils \
zlib1g-dev nano -y

Host

Ssh copy id.rsa.pub

cat ~/.ssh/id_rsa.pub | \
ssh -i .vagrant/machines/wocker/virtualbox/private_key bargee@wocker.dev \
'cat >> .ssh/authorized_keys'

Setup an SSH tunnel to the remote machine

ssh -f -R 9000:localhost:9000 bargee@wocker.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment