VM + Vagrant vs XAMPP vs WAMP (manual) vs LAMP (manual)

So, most people say that it’s preferred and best to use a VM and install vagrant via puphpet package. But let’s compare all of these installation options because they can actually be of good use.

Here is what most people say about XAMPP.


The bads


These are the 3 most popular comparisons for Xampp.

  • XAMPP is limited to the version of PHP they give out.
  • You don’t learn how to use the command line (terminal) at all.
  • You can’t install other stuff like Ruby on Rails.

The goods


  • If you are a novice user, you can install it with ease.
  • While it’s true that XAMPP is limited to PHP versions, that’s not entirely true. Just like WAMP (manual), you can install PHP 7.0.3 on an XAMPP version of 0.9 (the oldest version released in 2003).
  • With XAMPP, you can install basically PHP 5.2 - PHP 7.0.3. So you have the entire PHP version to work with.
  • You don’t really need Ruby on Rails if you aren’t working with it, but if you do, you can manually install it.
  • When you manually install Apache via WAMP (manual), you also learn a few commands in Command Prompt. This includes installing Apache using C:\dev\Apache2.4>httpd -k install and C:\dev\Apache2.4>httpd -k uninstall. You also learn how to manually install SSL using the openssl.cnf and generating your own local self-certified certificate.

The bad


Here is the main problem for Vagrant via puphpet.

  • Vagrant via puphpet only supports PHP 5.4 +. This should actually replace the whole “XAMPP is limited to the version of PHP they give out.” because you can’t have backwards compatibility with Vagrant via puphpet.

The goods


  • You learn a lot more commands in Linux compared to installing XAMPP on Windows using the WAMP manual installation.
  • You get to install all of these neat packages that allows you to run your local environment.
  • With installing Vagrant via puphpet on a VM, if you screw up your VM host, you can just junk the VM and still have a good running host.
  • If you happen to get a virus some how, you can just junk the VM host and not affect the main host.

Now, here are some points I would like to point out about Vagrant inside of a VM. Don’t hate me for this, but the part about junking the virus and being ok. That’s not entirely true. IIRC, in my Ethical Hacking class, we learned about viruses and worms and if you some how get a virus or worm. Then you’re screwed either way because the virus or worm can be transferred via networks. This means if your VM is using your internet, it can transfer itself to another host (someone else’s computer using the same wifi or internet) and then transfer itself back to your main host.

So yes, trying to safe guard yourself from a virus is actually impossible since IIRC from my Ethical Hacking class, viruses can change signatures and some of the popular anti-virus protection like AVG, Avest, Nortan, .etc won’t detect it. I remembered my teacher telling us NOT to run the virus, but to edit the other file with the same name so we can see what the virus actually looks like. If you were to run the virus, you would be fighting your life out just to save your VM.


I haven’t talked about WAMP (manual) and LAMP (manual) yet, but just by the name. You should know what it is. It’s installing PHP manually by installing Apache first, then PHP, then either mysql server or maria server. And occasionally uncommenting a few extensions like cURL, pdo, mysqli, GD2, mbstring, .etc.


I prefer installing the PHP environment manually because I get to choose which version I want. This makes it easy for me if my web hosting service provider only has a certain PHP version up to a point.


Let me know what you guys think and please do compare the 2 for me since I only do the manual installations.

1 Like

There is a lot more for using a VM to develop on.

  1. You can set up pretty much the same system as the production server. So your environment is a lot more efficient in terms of doing the right things for the right system, the first time. A golden rule for quality. Following this rule is practically impossible with XAMMP or WAMP, because you don’t run a Windows server on your Windows computer (usually).

  2. Almost every question asked on the Internet is asked for the LAMP stack or rather for Linux environments. So, if you are on XAMMP or WAMP, and you find something that sounds like a solution for your problem, the solution given might not, and often won’t, match for your system. Then you are left on your own to figure out how to use the answer for your system. This wastes time.

  3. Learning is much easier for Linux based systems, because practically every tutorial out there is based off of some variant of Linux. Windows is hardly ever used for learning tutorials.

  4. The software you can acquire to run on an application server stack (like LAMP) is often also offered as a Windows version. However, in my experience, Windows often causes more exotic issues and these issues are usually ignored or are pushed back in order to tackle higher priority Linux issues. So, being a pure Windows user is a disadvantage in this respect.

  5. The virus thing is hardly a consideration for using a VM. At least I’ve never heard it before and I rarely consider it. But, for sure, your host system is a lot safer, if you are downloading stuff out of the Internet onto the VM. One should just avoid using shared files between the host and guest. It takes only about 1-2 minutes to set up SFTP for deployment of code to the dev VM.

  6. On the PHP5.4 thing you mention as a bad for using Puphpet. It is an additional step, but there is nothing to stop you from removing the PHP version Puphpet/Vagrant installed and installing an older version. But, why would you do that? If you have legacy code in production running on anything under 5.5, you should be getting it up to 5.5 or higher. If you are developing something new, you should very much be programming it for 5.6 or even better PHP7. Although, the PHP devs have extended support for 5.6, I still think every dev, if they can, should be developing for PHP7.

  7. You touched a bit on the dispensibleness of the VMs. I’d like to emphasize this a bit more. If you screw up a VM, you can destroy it and start over. It takes all of about 10 minutes (automated, so you can go get a cup of coffee and do some surfing on the Internet, while you wait) to rebuild a new box. If you screw up your own computer, getting it back into a functional state could be a really frustrating ordeal and it will usually take a whole lot longer than 10 minutes, even if you are absolutely certain about what you are doing. If you aren’t absolutely certain, it could be you are doing more damage than good. So, from this perspective, a Vagrant box is a much, much better solution for beginners to work on, actually.

  8. You can set up multiple environments. Let’s say one project is on Ubuntu with PHP7 and Maria DB using Apache as the web server and another is with CentOS, PHP5.6 and MongoDB with Nginx as the web server. Let’s say you need a third with Debian and want to try out Caddy. With VMs, you could theoretically develop for the first two and try out the third all in parallel, if you wanted to. That might not be really feasible, but the point is, you can fire up different non-conflicting environments very easily, for each project you have. This is also impossible with Xammp and very unpractical with Wamp.

I will admit, using Virtual box and Vagrant has a bit of learning curve. Puphpet.com lowers that learning curve a lot. I would suggest to any PHP developer to use VMs as a development environment, especially beginners. There are way more positives for using VMs and only the learning curve as a negative in my book.

Scott

2 Likes

You can’t install Ruby on Rails?
Hmm that’s funny I better tell my computer(s) that it can’t run Ruby on Rails then. :slight_smile:

No it isn’t. I upgraded my copy to use PHP 7 as soon as PHP 7 was available even though it wasn’t for a couple more weeks before XAMPP offered a version that included it.

I also upgraded it to mySQL 5.7 rather than switching to mariaDB.

While it is easier to install all the products included in XAMPP in one go using the package than installing each separately, it is actually easier to upgrade each product separately than it is to install a replacement version of the entire package.

Although I develop PHP applications on Windows and the live environment is always on a Linux I don’t use VMs or Vagrant and I don’t think I will switch to that soon, if ever. It’s not because I think Vagrant is not a brilliant idea - quite contrary, I believe it is - it’s just that for me it provides a solution to a problem that doesn’t exist or that exists in trace amounts. It is so extremely rare for me to find incompatibilities in running my code between my development machine and live server that it’s simply not worth for me to spend time learning and bothering with VMs.

PHP versions is rarely a problem, I just keep a highest current version and if I sometimes need to switch I can easily do it with a manually crafted bat file. My IDE alerts me of incompatible structures in my code and that is enough.

I also don’t use WAMP/XAMPP/whatever, I always install each segment manually from scratch - now that I’ve done it several times and have the config files ready it is very easy for me to do it. The advantage is I have full freedom of tweaking and configuring each component and additionally I’ve found that the knowledge about apache and php config options can come in handy sometimes.

I know that for certain projects or development styles Vagrant can be an indispensable tool - it’s just that now for me there is no need for it and I prefer to keep things simple.

@s_molinari very nice detailed explanation.

I don’t know. I remembered someone saying that you can’t install Ruby on Rails with XAMPP, but I know that’s not true because it’s possible to install anything.

Yes, but I’m just following the list on this page http://www.sitepoint.com/re-introducing-vagrant-right-way-start-php/
I know it’s not true, but I have to list what other people list because apparently, if I list what I think is right, it’ll always be wrong.


Well, the article says

XAMPP is version locked – you can’t switch out a version of PHP for another, or a version of MySQL for another. All you can do is use what you’re given, and while this may be fine for someone who is 100% new to PHP, it’s harmful in the long run because it gives a false sense of safety and certainty.

Which basically sort of means that it’s limited to the PHP version they give you. I know this isn’t true because I installed XAMPP 1.7.7 which has PHP 5.3.8 and then I took PHP 5.3.7 from PHP’s archives and I overwritten all the files with PHP 5.3.7 and I was able to run it with 5.3.7 instead of PHP 5.3.8. I was testing ircmaxell’s password compatibility on the lowest possible PHP version.

Well, I know that there’s WAMP, but what I mean by WAMP (manual) is installing it in segments like you explained. Installing Apache first, then your package of PHP, then mysql server or maria server, and for optional phpMyAdmin.

There isn’t any learning curve using puphet.com on a Linux based machine like a mac. There can be problems on windows but much less problems long term when extensions need to be installed. I’m running a vm on a surface with windows 10. The only problem I’ve run into is setting up the Samba file sync. Everything else has worked like a charm and using Samba is optional.

I don’t have anything against developers using Xamp/Wamp. In fact I think it is the developers responsibility to manage their own lical environment. If that what their comfortable with it is fine. I just don’t want to see it become a problem with when other things are needed like extensions and they have no idea how to add those things or modify their local environment. A perfect example is xdebug. I’ve worked with several epeople who don’t use xdebug simply because they don’t know how to add it to their local environment.

Using puphpet adding xdebug is a matter of just checking a box, any extension for that matter almost is. Which is one of many reasons why I do believe puphpet.com is far superior than Wamp/Xamp. Nothing is faster than simply adding a line to a Yaml file to install extensions and other various software packages commonly used in dev environments.

I also work on multiple projects with different environments. That is much easier to manage on vms than a single machine. I think a fair amount of developers are probably responsible for projects on different environments and with different versions of php, extensions, etc. The Mamp/Xamp people just cope and hope everything “works”. Where as I actually have separate vms to much more closely imitate each separate project environment.

2 Likes

I wholeheartedly agree.
This is when a package manager shines.

An WAMP/XAMPP “all-in-one” click-to-install-as-a-service is good enough for a lot of uses, and I’d rather see a newbie use that to get started rather than to give up in frustration trying set up a custom environment.

But for anyone that has had experience wrestling with this _ is dependent on that _ ver # _, which in turn is dependent on _ ver # _ etc. etc. problems, having something that takes care of that is a godsend.

Yeah, like I ask have any of you ever attempted/tried to install OAuth on a windows based Xamp set-up. Like good luck on that one. Where as on my vm it is a matter of adding two lines. Also PEAR and PECL packages on a windows or even native set-up… much easier with puppet. Using puphpet I can spin up an environment in a matter of minutes which includes most required project dependencies. It is just makes MUCH more sense to be using puhpet.com to spin up VMs for local dev. Unless you’re working on <=5.3 puphopet.com should be a no brainer imo.

So we have exactly the same XAMPP version except my XAMPP 1.1.7 has PHP 7 and mySQL 5.7 installed.

The only reason why I use WAMP (manual) is because for some reason, the PHP devs don’t make LAMP packages for all the PHP versions. So when I’m on Ubuntu, I am stuck with using either PHP 5.6 or PHP 7. I would like to test every single version to make sure everything is compatible, but the only way to do that is to rely on using a WAMP stack.

Well, I actually have multiple PHP installed. My default one I use is PHP 7.0.3. I use XAMPP as an alternative to test for version compatibility.

Those are the only two versions of PHP with full support.

PHP 5.5 only gets security patches now and even that will cease in July.

Please don’t test with unsupported versions of PHP. Even if the testing is automated, it is wasted effort. If a customer of yours is on an unsupported version of PHP, then it is your duty as a developer to tell them, “Sorry, I’d love to help you, but you are running outdated, unsupported and possibly insecure version of PHP. I can help you by getting you up to a more modern version of PHP, then my library/ software will work great for you too!”

Oh, and if they do ask for your help to upgrade their system to a higher version of PHP, your experience using a Linux VM locally will come in real handy. At that point, those devs using Windows only to develop on will be shrugging their shoulders. :wink:

Scott

Ah I see. Well that’s a bit of a bummer then.

But let’s say the user is using a free hosting service provider. Let’s say they signed up on 000webhost. 000webhost’s PHP version is stuck at 5.2. What then? Find a new host? It’s true you should find a new host, but what if the client doesn’t know or want to switch hosts? What if they have more than just your files on their account?

True, but if you have a dev who’s installed Apache, PHP, and MySQL server on both Linux and Windows, it’s not that hard really to switch between the 2 OS.

To be honest, I’d avoid bending to the needs of anyone who is using free hosting and I’d also gladly tell them “tough luck”, if their webspace doesn’t work with my up-to-date software.

I am not sure what your point is here.

Scott

That’s actually a really bad business plan. It’s like Microsoft saying “Screw all of you Windows 7 users, you have to use Windows 10 now and we don’t care if you like it or not. And if you don’t like it, tough luck.”

The point is, it doesn’t matter where your local PHP environment is installed in. If you know how to install it in Linux and you prefer Windows. Then it’s your choice. An example can be myself. It’s not really that hard to install the PHP environment on Linux. All you just have to do is install Apache or Ngix first, then either PHP 5 or PHP 7, then MySQL server or maria server and that’s it. Oh and you learn all the Linux commands while you install LAMP manually like this. This isn’t the LAMP stack I’m talking about, it’s manually installing each package. You learn how to use the terminal.

I actually have less problems installing PHP on Ubuntu and Windows than having problems with having to deal with sticking to 1 specific PHP version because they don’t include others.

But hey, I’m always wrong so what the heck.

It is more like Microsoft saying WindowsXP is unsupported, but developers are still developing and helping people on Windows3.1 and Windows 95 or OMG Vista! LOL!

Scott

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.