MariusP
MariusP

Reputation: 492

Complicated setup with Git, Laravel, PHPStorm and VPS

What I have so far:

What I am trying to achieve:

Fast and easy code deployment, as in: write the code in Windows via PHPStorm, test it on the LAMP machine, deploy to VPS if necessary.

The problem is that I need to use some php artisan commands on LAMP machines to get some code generated. This means that I always have to synchronize PHPStorm with LAMP files tree in order to see the changes. Then, I need to also sync the other dev (LAMP) machine and the other PHPStorm running on Windows machine number 2. I know that this can be done via Git. So everytime I use the command line to generate code, I need to sync 4 machines (excluding the deployment server).

Later, if I add another pair of Windows/LAMP dev machines, the complexity grows.

Back in the days of Dreamweaver, I could write code directly on the deployment server. Not the greatest idea, but it was way much simpler and faster, and that's what I need now.

Any ideas on how can I simplify this?

Switching to WAMP so I can have files in sync with PHPStorm (because all is locally) is not OK because... Windows and PHP libraries issues :)

Also, switching to Dreamweaver is not OK either.

What other options do I have?

Thanks!

LE: on the side, I am also thinking if a NAS can be helpful for this type of problem.

LLE: is Linux Desktop + PHPStorm the only straight solution?

Upvotes: 0

Views: 438

Answers (2)

MariusP
MariusP

Reputation: 492

How I solved the problem:

I have an extra Mac, on which I installed everything for my PHP ecosystem, including the IDE, so everything is local. That's the dev machine. Then I manually copy the code to the VPS when needed. Another solution was to install Ubuntu Desktop (or similar) on dual boot with Windows and use it as a local dev environment.

Much faster development / deployment :)

Upvotes: 0

Mihai Stancu
Mihai Stancu

Reputation: 16107

No matter the protocols

You can put your code outside of the guest machine and configure the guest machine to mount the code (mount a folder from the host inside the guest).

Apache will run slower because it will use the mounted remote-folder but PHPStorm will run at its maximum speed.

Taking protocols into consideration

Try using SSHFS on windows.

I use SSHFS for remote development from my Linux host machine to headless vagrant boxes (and/or to remote development servers / staging servers).

It's much faster than SAMBA (the windows SMB protocol) and oddly faster than NFS even though SSH uses encryption.

Coleages using Windows+SMB often leave their computers for 30 min while PHPStorm is indexing and git branch changes on the dev machine go unnoticed for minutes at a time.

Indexing over SSHFS usually takes less than 5 min on a Symfony2 project. Branch changes are detected in less than 15s.


Using Linux (shameless plug)

Linux is nice, and it's free, and it works out of the box (Ubuntu) -- including pesky USB-Modems which would normally require an install on windows.

You already know how to handle a Linux CLI the learning curve is already halfway crossed.

Auto-updates don't rule your life, they're not the king of you!

All the applications you need are part of the software repositories you don't need to look for anything, download 40+ executables and attempt to install them just to be welcomed by an error "invalid architecture", "windows version not supported", ".NET framework version too old", "DirectX version too new (wtf?)", "your cousin is a software pirate".

Dependency management is a concept Linux never fully solved -- but at least the bloody tried and in 90% of consumer use-cases it fits the bill. Windows is still eating glue at the back of the class.

Upvotes: 3

Related Questions