Vagrant Support in PhpStorm

Posted on by Maarten Balliauw

The latest version of the PhpStorm 7 EAP comes with Vagrant integration! Vagrant is a tool which helps us create reproducible development environments. By scripting a virtual machine, Vagrant allows us to share a development machine by sharing a simple script. Other developers can then launch an identical machine by running the vagrant up command. Or by doing this from within the IDE!

Once the Vagrant Box is up and running, we can also make use of the built-in SSH terminal in PhpStorm to work on the virtual machine remotely.

Have a look at our tutorials page on Vagrant support for detailed instructions. If you are new to Vagrant, check out their website as well as PuPHPet to quickly craft a virtual machine with all the packages you need.

Give PhpStorm 7 EAP a try. And as always, let us hear your thoughts in the issue tracker, through the comments below or in our forums!

Develop with pleasure!
– JetBrains PhpStorm Team

Comments below can no longer be edited.

26 Responses to Vagrant Support in PhpStorm

  1. Gustavo says:

    September 2, 2013

    The built-in SSH terminal is nice, the “vagrant up, halt, restart” menu is ok, almost unnecessary…

    The amazing thing would be integrating phpmd, phpcs, phpunit, code coverage and things like that directly with the built-in ssh (through that, integrating with vagrant).

    Basically, we tell the IDE where are the executables (eg. /usr/local/phpcs) and the IDE call it and read the output through a terminal… not necessarily as a core feature, but will someone be able to develop this as a plugin?

    • Mikhail Vink says:

      September 3, 2013

      Well, we actually have built-in support for PHPUnit with code coverage (including PHPUnit on server), so it can be run easily. Please check this webhelp page http://www.jetbrains.com/phpstorm/webhelp/enabling-phpunit-support.html

      As for phpmd and phpcs please check Settings | PHP | Mess Detector and Settings | PHP | Code Sniffer – you can provide executables paths there, than enable phpcs/phpmd inspection in Settings | Inspections | PHP and it will output right in the editor marking validating code on-the-fly.

      Moreover, you can configure any SSH Remote External Tool in Settings | Remote SSH External Tools – so you can add some tools configured in vagrant.

      • Michael Goodness says:

        September 27, 2013

        This isn’t strictly true, though, is it? My understanding is that we can’t use the IDE’s code coverage functionality in a “PHPUnit on Server” configuration. I’ve tried, and the “Run with Coverage” button is always disabled. If I’m missing a setting, I’d sure appreciate being pointed in the right direction.

        • Maarten Balliauw says:

          September 27, 2013

          Not sure if you are using XDebug or Zend Debugger, but for XDebug, make sure the coverage settings are enabled on the server (see http://xdebug.org/docs/code_coverage)

          • Michael Goodness says:

            October 2, 2013

            XDebug is configured with code coverage enabled, but the “Run with Coverage” button is still grey.

            This issue – http://youtrack.jetbrains.com/issue/WI-9903 – seems relevant.

  2. Josh C says:

    September 17, 2013

    Any idea if/when this is coming to the ultimate edition?

    • Maarten Balliauw says:

      September 18, 2013

      We can’t give an exact timing so far but it will come to IntelliJ IDEA for sure.

  3. Phil Moorhouse says:

    September 24, 2013

    Will this include syntax highlighting support for vagrant and puppet files in the editor?

    • Maarten Balliauw says:

      September 24, 2013

      You could use TextMate bundles to do this.

    • Rafal Enden says:

      August 22, 2014

      You can add Vagrant file to Perl filetypes (Preferences > File Types > Perl).
      It will work fine since Perl syntax is similar to Ruby.

  4. Alan Pich says:

    October 8, 2013

    Is there any way of proxying the built-in phing support to a vagrant box? Would be excellent to be able to call phing tasks on a project, but have them executed in the vbox/vagrant environment

  5. Już jest PhpStorm 7.0: PHP 5.5, Vagrant, SSH, wsparcie frameworków i inne | webMASTAH says:

    October 24, 2013

    […] obsługa Vagranta – wybór środowiska, start/stop czy też korzystając z kolejnej nowości zarządzanie nim […]

  6. Kukusf says:

    October 26, 2013

    This is amazing!!!

  7. David says:

    October 31, 2013

    it seems that PuPHPet is not fully supported on PHP Storm; i execute the “up” command and the VM is created, but all the PuPHPet customization it’s not installed. then, i’ve executed vagrant up manually from the local folder and the “up” command launched the PuPHPet customization OK. i suspect that PHP Storm executes only the vagrant part because some type of path problem

    • Maarten Balliauw says:

      November 1, 2013

      Do you have all files and folders in the project root? Here’s the repo I used in the demo video: https://github.com/maartenba-demo/VagrantDemo

    • daniel says:

      November 19, 2013

      I had the same problem.
      It didn’t work until i called “vagrant up” from the terminal.

  8. Seydamet says:

    December 11, 2013

    It would be nice if vagrant autostart for current project when I open my IDE. And vagrant suspend if I close it.

  9. Vagrant? Кто такой? Чем знаменит? | Блог DataArt says:

    February 6, 2014

    […] Относительно поддержки PHPStorm Vagrant — всё хорошо. В любой момент мы можем запустить в Vagrant наш код. Более детальное описание этого процесса можем найти тут. […]

  10. Running PHPUnit tests over SSH on Vagrant with PhpStorm 8 | JetBrains PhpStorm Blog says:

    July 21, 2014

    […] Since introducing Vagrant support in PhpStorm 7, we’ve had tons of feedback from our users. While PhpStorm has been supporting running PHPUnit on remote servers for quite a while, developers working with Vagrant clearly prefer doing this over SSH instead. And that is exactly what we can now do using PhpStorm 8. […]

Subscribe

Subscribe for updates