I do PHP Development on WAMP but sometime it don’t work properly when I upload the files to a Linux server, its involve a lot of testing and annoying.
I am looking for a solution to do PHP Development on Windows but the files will be sync with Linux Server. I do not want to use SFTP/SSH clients like WinSCP to view or edit files.
I was told to look at vagrant, is there any other solution?
2
I recommend using VirtualBox to run a Linux instance within your Windows environment. Install Linux on VirtualBox and you’ll be able to share a directory between the two, meaning you can edit your files locally within Windows and they’re immediately available on your web server running within the Linux instance. Install the same Linux distro and version as your live server for accurate testing.
3
I think the obvious answer is to set up a standalone local linux box. It doesnt have to be a heavy duty machine – just enough to run Apache & MySQL. You dont even need a GUI on it. Then set up Samba on it so you can have Windows shares. After that you’ll be able to open and save files like you would on a normal networked Windows PC.
Another thing to consider is if you are using standalone FTP clients to transfer files now, look at switching to an editor that supports remote file loading & saving natively. For example, w/ Eclipse & the Remote Systems plugin, you can open & save remote files via ssh very easily.
Php is meant to be cross-platform, but if you hard code windows specific things in your php code (Like Paths) or making assumptions about directory/file permissions things might not work the cross-platfrom way.
- Try this article for portable paths : Write file manipulation cross-platform PHP code
- Use htaccess files for specifying permissions on project specific files.
- Like @Matt S suggested use a Virtualized Linux environement to test your code in target environement (Automated tests are preferred by the way)
1