Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question

closed as off-topic by MichaelT, Glenn Nelson, Corbin March, GlenH7, Yusubov Aug 18 '13 at 4:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – MichaelT, Glenn Nelson, Corbin March, GlenH7, Yusubov
If this question can be reworded to fit the rules in the help center, please edit the question.

    
What happens exactly when it "don't work properly"? Are there recurrent problems?Maybe you have hardcoded windows paths or directory/file access assumptions? –  Chedy2149 Aug 17 '13 at 21:49
    
I don't want to go into details what it dont work but there is a few possible reason like files permission, open source library file only work on linux, PHP modules, etc. Now I am more interested to work on Linux Environment now. –  user88432 Aug 17 '13 at 21:53

3 Answers 3

up vote 9 down vote accepted

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.

share|improve this answer
    
How is that different from vagrant? Because with vagrant you can do the same thing. –  user88432 Aug 17 '13 at 21:54
    
Virtualbox is the platform for hosting your virtual machine (linux). Vagrant works on top of that to set up your specific environment requirements. –  Matt S Aug 17 '13 at 22:01
    
Vagrant is much easier to manage, pretty much to the point of making using VirtualBox directly a complete waste of time. vagrantbox.es will likely have the version you need. –  Jordan Aug 18 '13 at 2:16

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.

share|improve this answer

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)
share|improve this answer
    
Like I said I am more interested to work on Linux Environment now. I no longer want to do testing and development on Windows Environment. –  user88432 Aug 17 '13 at 22:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.