Is it dumb to develop for LAMP on WAMP?

If you can, I'd invest in some kind of Linux, or at least *nix, development environment. For simple applications and websites, your setup is fine, but you will eventually run into subtle differences when you deploy.

Here are some things off the top of my head you'll want to watch out for if you stick with your Windows environment.

  1. File paths. A lot of PHP functions take file paths as arguments. Do not use the Windows backslash (\) separator. Even though you're on Windows, PHP will let you use a forward slash separator. Ideally abstract this away with your own file path class.

  2. Apache Modules, PECL Extensions. Apache Windows and Apache Unix often come with a different set of Apache Modules installed by default. Also, the same version of a module may run differently on a different platform. If your application relies on any Apache module, make sure it's available for both platforms. The same goes for PHP custom extensions (PECL).

  3. Process Forking. Using exec, `, etc. in a web application is a bad idea to begin with, but if you're using these functions they're going to behave differently between Windows and *nix

  4. File writing, locking, etc. works different

  5. Email is handled differently on both platforms

  6. The PHP group's code word for Windows is "some platforms". You can research more on your own if you'd like

In general, the closer your development environment matches your production environment, the fewer environment/deployment related issues you'll have.


I've been doing it for the last couple of years and haven't run into any problems yet - if anything it gives you an advantage by forcing you to write more portable code.


Permissions and the fact that on Windows filenames aren't case-sensitive are the two things I can think of that have been a pain to me. But they are

  1. Solvable, at worst with an FTP client to change permissions.
  2. Good, easy ways to make you a better programmer (in a small way, yes).

In theory, PHP and MySQL should be completely platform-independent.

In practice, if you're going to have a real production application, I suggest you to have a testing environment mirroring the production one, to avoid surprises.

Tags:

Lamp

Wamp