- Project (Drupal) is served on
/var/www/htmlin the Vagrant box - Local project files location:
c:\Users\username\Work\projects\my-project\repo\html - Guest machine IP is 10.0.2.2 (if this doesn't work, run
route -neein the VM and look for the gateway address)
- If the extension is not currently installed (run
php -i | grep xdebugin the VM and check the output), follow instructions in https://xdebug.org/docs/install
- Check the location of your
php.ini(in this case located at /etc/php/7.0/apache2/php.ini) file and add/change the following configuration:
xdebug.remote_enable = true
xdebug.remote_autostart = true
xdebug.remote_host = 10.0.2.2
xdebug.remote_port = 9000
xdebug.remote_log = /var/log/xdebug.log
xdebug.max_nesting_level = 1000
- After setting this, remember to restart the webserver:
sudo service apache2 restart.
- sudo apt-get install php-xdebug
- Configure XDebug: http://purencool.com/installing-xdebug-on-ubuntu
Awesome post, James!
Thank you very much!