Saturday, November 3, 2012

Setup PHPStorm to Directly Access Your Remote Server or Virtual Machine

I wanted to separate my desktop from my development environment so I have a separate server having many virtual machines running on Virtual Box. I am using PhpStorm for the development to boost my productivity. Since I'm developing, I needed to set it up in a way that I had to edit the files directly but remotely. PhpStorm doesn't provide the feature as is like Zend Studio does.

The solution, run a samba daemon on the development machines and mount the folders to your local desktop.

Here's how.

For Fedora 17 host and a CentOS VM

On the CentOS VM,

yum install samba samba-client
chkconfig --level 2345 smb add
chkconfig --level 2345 nmb add

vim /etc/samba/smb.conf #edit configuration file to specify target dir to share

/etc/init.d/smb start
/etc/init.d/nmb start

On the Fedora desktop,

yum install samba-client
mkdir target_dir
mount -t cifs -o username=your_user,password=your_password //centor-server/target_dir target_dir
mount -a

You can then use target_dir as directory or folder for PhpStorm to open. The above how-to and principles can be used with other IDEs or editors.
  • Related Links Widget for Blogspot

1 comment:

Brandon Tilley said...

This is helpful, but how would you run git directly from PHPStorm in this scenario?