2

it's possible to use vagrant to setup a environment for php development with some tools like PHP_CodeSniffer, PHP Mess Detector, etc, and then use sublime text plugin sublime-phpcs in the host machine to use this tools from vagrant?

I wanted to avoid install all this tools in my Host machine(mac os) but still use the sublime text with the plugin to develop in the host machine.

Thanks!

pwerspire
  • 23
  • 3
  • http://stackoverflow.com/questions/11663562/editing-file-from-sublime-text-2-from-command-line-when-sshd-into-a-vagrant-vir?rq=1 maybe –  Jan 05 '14 at 16:04
  • it's different.. What I want to accomplish is to avoid installing some php tools directly in my host machine.There are some plugins in sublime text that use this php tools. So I wanted to avoid messing my host machine with this tools but still use them inside sublime – pwerspire Jan 05 '14 at 17:44

1 Answers1

0

Technically you could probably point the sublime-phpcs plugin to an executable bash script which could run PHP on the VM through SSH. Something like this lets you run your VM's PHP:

ssh -i '/path/to/vagrant.pem' vagrant@vmip php

Where vagrant.pem is the SSH key that comes with vagrant.

It would also need to convert the local file path into a path that the VM could actually reach locally as well - either that or perform a reverse SSH connection back to the host.

In the end it's probably going to be very complicated and you might just be better off installing PHP locally.

Matt Cooper
  • 9,962
  • 2
  • 31
  • 26
  • Thanks Matt, yes it seems more complicated that I had thought.. Probably the best option like you said is just install locally, I will just do that. Anyway thanks for your answer! – pwerspire Jan 05 '14 at 23:17