Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it dumb to develop for LAMP on WAMP?

Tags:

lamp

wamp

After becoming somewhat estranged open source, and spending some years developing web applications in ASP.NET, I'm going to start doing quite a lot of PHP / MySQL development.

I've quite painlessly installed WampServer to get a development environment up and running on my Windows machine, but the platform I'll be targeting will most likely be Linux. Am I likely to run into problems due to developing on Windows while targeting Linux? Is it advisable to invest in getting a Linux environment setup in which to develop my LAMP applications?

like image 218
Nick Higgs Avatar asked Oct 22 '08 21:10

Nick Higgs


People also ask

What is better LAMP or WAMP?

WAMP uses PHP (a script-based programming language) for development and testing. Unlike other similar local servers, LAMP is multi-lingual in terms of development. It supports coding done in PHP, Perl, and Python. XAMPP uses MariaDB, which is a relational database management system.

Is WampServer good for production?

YES, it can be used in production under condition that you install the secure WAMP distro. And yes it can run on Internet and not just intranet. Here is a link to a secure WAMP for production where you can customize the security level and other settings to suit production environment.

Is WAMP and LAMP same?

Windows, Apache, MySQL, and PHP is commonly abbreviated as WAMP. Some people may confuse with LAMP but the only difference between the two is their operating systems. In the case of LAMP, L stands for Linux. Setting up a server included the installation of all the software listed in the abbreviation.


1 Answers

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.

like image 68
Alan Storm Avatar answered Oct 15 '22 17:10

Alan Storm