2

I have following development setup for my PHP projects:

  • Working station running on Windows 7 with PhpStorm IDE.
  • GIT for version controlling.
  • CentOS on virtual machine (VirtualBox) with Apache and MySQL (copy of production server).

So far, I've been sharing project's source folders between host and guest systems and it was working quite well only really slow. The reason behind this is that Apache was reading files from remote folder (mounted locally). After doing some research, I found out that this set up can be improved by using disk mapping (Samba) instead of folder sharing. So I did that change. I configured my PhpStorm to automatically deploy files to mapped drive. Everything works like a charm now, except for one problem - when I change branches I need to synchronize project's local folder with the one on mapped drive and that takes time, a lot of time (like branching in SVN). Is there another way to handle this than just working on files directly on mapped drive?

logc
2,19016 silver badges19 bronze badges
asked Jun 13, 2014 at 12:52

2 Answers 2

1

The most efficient setup for your configuration would be to git clone the repo via SSH directly into the virtual machine (in a location that's accessible to the SAMBA user), mount the "remote" folder from the VM as a network drive in Windows and use PHPStorm to open the project directly from that drive.

The point is this: edit the project directly from the mapped location, do not use PHPStorm's deployment options to deploy your changes to the mapped drive. It will still be slow, but it should be a bit faster than your current setup.

answered Jun 15, 2014 at 22:55
1
  • For me, PHPSTORM is slow on large projects via mapped folders in VirtualBox. Commented Apr 5, 2015 at 6:11
2

I have used a setup similar to yours to do local develoment. In my case, I set up git (actually I use Mercurial, but same idea), and added the VM as a remote on my local repo. I can then check out different branches or commits through an SSH connection to the VM. If the VM has a GUI, you could also manage the remote repo that way. If you pretty much always want the VM to use the latest commit on master, you can even set up a git hook that automatically checks it out when you push up.

answered Jun 14, 2014 at 2:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.