![]() Set the name, the host, the web server port, the debugger that we will use (xdebug), And the most important, set the path mapping, this maps the path in the remote server against the files in your local machine.Īs I said before, In this case the src folder in my local project is mounted in the remote server with NFS into the /var/that is also the Directory Root if the Web Server running in the Virtual Machine. ![]() Second add the server using the and fill the new window options Set a name to identify the server, I use the same than the domain. The next step is configure the server execution environment, Goto Run > Edit Configurations.Īgain in the top there is a button with a Plus Sing, Click and some options will be shown, Select “PHP Web Application”.Ī new window will be open and there you have to put all the information related to the vagrant web Server. 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 ![]() 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 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. 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. After all, we want you to be successful with the tools and workflows you know and love.This is a guide about how to use Xdebug with PHPStorm if our project is running in a Vagrant machine. It works exactly the same on Windows or Linux, and with WSL2 as well. You can get a working debug environment in a few minutes! We’ll walk you through it in this screencast using macOS. The combination of PhpStorm and DDEV‘s plug-and-play approach to debugging makes those configuration struggles obsolete. Enter our open source local development environment, DDEV. The days of print-debugging are long behind us! Xdebug and PHP IDEs have made that approach unwieldy, but often the configuration between your IDE, PHP, web server, and Docker is challenging and fragile.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |