Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Phpstorm helper, devtools on vagrant

Hi, don't know if there were a thread like this but I couldn't find the answer. I'm using phpstorm and I would like to have some kind of helper with available functions etc, however I have devtools installed in VM. Is there any way to set up devtools from Virtual Machine? A standalone plugin maybe or something? Thanks.



1.8k

Just create a shared folder between your VM (where the devtools are installed) and your pc, and then setup the devtools in phpstorm as described here: http://blog.phalconphp.com/post/24476683703/integrating-phalcon-with-phpstorm-ide.



2.6k

Hey, thanks for answer. I've installed dev tools in /var/www but now runned in another issue. I've changed symlink but still get /usr/bin/phalcon permission denied. any thoughts?



1.8k
Accepted
answer
edited Oct '14

Are you trying to run phalcon <command> commands from inside phpstorm to your VM? Or do you just want to include the IDE stubs in phpstorm to get code completion?

If you just want the code completion, then mapping that shared folder from your VM should do. If you also want to call the phalcon-devtools commands from your pc in your VM, then... I'm not sure about running phalcon commands from within phpstorm on your pc to your VM, pretty funky situation. If that VM is not connected to the outside world, you could sudo chmod +x 777 /usr/bin/phalcon in your VM to allow the binary to be called anonymously.

But unless you've got some reason to not install the phalcon-devtools on your pc, it'd be a better idea to just install those devtools on your pc locally to run any phalcon commands. Just makes more sense. HTH, best of luck!

Sven



2.6k

I would need to install apache and php in my local machine wouldn't I? What I'm trying to do is to have phalcon commands on my VM but have ide stubs on my local machine.

I will just get another copy of phalcon tools to my local machine and try to set up my ide. Thank you for your time ;)



1.8k

If you want to run phalcon commands in your local machine, then you only need to have PHP installed. That, and Apache + MySQL can be easily achieved with XAMPP in any environment, no sweat ;)

Have it your way, & set things up how you like. Above all: have fun with Phalcon! :)

On 13/10/2014 21:54, mirago wrote:



489

Bringing up an old topic up but I was interested in using the devtools with PhpStorm 9 while using a VM, and finally managed enabling code completion:

BEFORE EVERYTHING : Do not install the devtools prior to syncing the vm/phalcon-devtools with the host.

  1. Create host folder and guest folder in vm that will get synced (i.e: <your-path-to-phalcon-vm-vagrantfile>/phalcon-devtools and /home/vagrant/phalcon-devtools)
  2. Sync these folders with the vagrantfile (i.e: config.vm.synced_folder "phalcon-devtools/", "/home/vagrant/phalcon-devtools", type: 'nfs')
  3. Install the devtools in your vm using the instructions here: https://docs.phalconphp.com/en/latest/reference/linuxtools.html
  4. If everything went fine, you are now able to use $ phalcon in your VM and you should be able to see the synced files on your host.
  5. On your host, edit both .bat files in the root of phalcon-devtools and in ide/phpstorm so the path reflects the current location of these .bats
  6. (optional?) Add php and host/phalcon-devtools in your PATH. For php I used my old xampp path.
  7. Now in PhpStorm, bring up the settings, and in Language & Frameworks > PHP add the path to host/phalcon-devtools (not ide/phpstorm)
  8. It should now work :)

Hope this helps!