
Hit Ok and you will see that now you have a new interpreter If all is good will allow you to click into the Ok button, otherwise will show you the error that is probably related to your vagrant machine. The IDE will automatically detect your vagrant options, will login into the vagrant using the vagrant ssh method and will discover your Vagrant machine options. there you have to select the directory where is your vagrant file (the root of the project). In the top of the new window there is a button with a plus sing to add new interpreters, go and hit that button and select Remote from the list of optionsĪ new window will be open and there you must select Vagrant option.

Open your project, once is open go to preferences and look it for interpreters under Languages and Frameworks > PHP branch.Īdd a new interpreter using the three dots buttons next to interpreter, that will open a new option window. With that you vagrant machine is ready, the next step is to setup PHPStorm
#XDEBUG PHPSTORM MOD#
Now restart your php-fpm process (or apache if your are using apache with mod php). This will enable debug connections from any remote machine on the port 9000. Put these options in the file zend_extension=xdebug.so
#XDEBUG PHPSTORM INSTALL#
In the vagrant machine run this command to install vagrant$ sudo apt-get install php5-xdebugĪfter that edit the debug configuration in the vagrant machine vagrant$ sudo vi /etc/php/5.6/fpm/conf.d/20-xdebug.ini The first step is to install and configure xdebug. The local files are available in the Vagrant machine using NFS, and the src folder is mounted in /var/Setup Xdebug I’m assuming that your project as a root folder and the Vagrant file is in the root, also that your source folder is inside of a src folder that also is located in the root of your project. The Vagrant machine is running an Ubuntu and it has PHP 5.6. The site is running in the Vagrant machine and I can access using the domain because the host entry is in the host table of the host machine. I can connect to the vagrant machine from my host machine using the network and the IP address as any machine, in other words the virtual machine is using a bridge configuration.
#XDEBUG PHPSTORM HOW TO#
The hard part of this guide is to know how to properly setup the IDE, lucky for us the people of JetBrains, as always, are doing a great job and they have a good integration with vagrant ready for us, following these steps you won’t have any problem to keep this running quickly.įor this guide I’m using OSX with PHP Storm 2016.2.1, I have a Vagrant Machine using VirtualBox with a Drupal site project and the vagrant machine has his own IP address. This is a guide about how to use Xdebug with PHPStorm if our project is running in a Vagrant machine.
