We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

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.



3.1k

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: https://blog.phalcon.io/post/24476683703/integrating-phalcon-with-phpstorm-ide.



4.5k

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?



3.1k
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



4.5k

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 ;)



3.1k

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:



1.1k

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)
    • Sync these folders with the vagrantfile (i.e: config.vm.synced_folder "phalcon-devtools/", "/home/vagrant/phalcon-devtools", type: 'nfs')
    • Install the devtools in your vm using the instructions here: https://docs.phalcon.io/en/latest/reference/linuxtools.html
    • 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.
    • 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
    • (optional?) Add php and host/phalcon-devtools in your PATH. For php I used my old xampp path.
    • Now in PhpStorm, bring up the settings, and in Language & Frameworks > PHP add the path to host/phalcon-devtools (not ide/phpstorm)
    • It should now work :)

Hope this helps!