Setting up xdebug on scotch box/vagrant on Arch linux

Install Vagrant

sudo pacman -S vagrant

To install virtualbox

mkdir works

git clone https://github.com/scotch-io/scotch-box.git works

cd works

vagrant up

install sublime 3

install package control on sublime 3

http://packagecontrol.io/installation

install openssh

vagrant ssh
sudo apt-get update
sudo apt-get -y install php5-dev php-pear build-essential
sudo pecl install xdebug

copy the xdebug.so location
you can also find it with find / -name ‘xdebug.so’

/usr/lib/php5/20131226/xdebug.so

in /etc/php5/apache2/php.ini

;;;;;;;;;;;;;;;;;;;;;;;;;
; Added to enable Xdebug ;
;;;;;;;;;;;;;;;;;;;;;;;;;;
;
zend_extension="[enter path here]"
xdebug.default_enable=1
xdebug.idekey="sublime.xdebug"
xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_host=10.0.2.2 ; IDE-Environments IP, from vagrant box.
;

sudo service php5-fpm restart
sudo service apache2 restart

refresh phpinfo to check xdebug

in sublime -> tools -> command pallete

install package

xdebug client

Project -> Save project as

works.sublime-project
{
"folders":
[
{
"path": "/home/username/works/public"
}
],
"settings": {
"xdebug": {
"url": "http://192.168.33.10/",
"port": 9000,
"path_mapping": {"/var/www/public/" : "/home/username/works/public/"},
"super_globals": true,
"close_on_stop": true
}
}
}

Leave a Reply