Installing Apache and PHP on Linux VS Installing Apache and PHP on Windows

June 9th, 2010 in Articles, Review by

The majority of websites on the Internet utilize the open source Apache web server and PHP for back-end scripting on either a Windows hosting or Linux hosting service. It’s a robust and versatile website hosting solution, regardless of the operating system used. However, there are some differences between the two when it comes to installing, administering and operating websites and web-based applications. While the Apache, PHP and optional MySQL combination provides a fairly smooth experience whether the host operating system is Windows or Linux, the installation process differs somewhat between them in terms of user friendliness.

Installing Apache and PHP
image source: Xocoo’s Weblog

To begin with, installing PHP and Apache isn’t really that complicated on either platform. At least, you certainly don’t need a computer science degree to pull it off. About five minutes worth of time Googling the subject will tell you all you need to know. Apache and PHP on Windows is fairly straightforward for most users, being installable and configurable via the GUI, although the Linux version is as well. You should be able to setup a web server in under ten minutes on both. Unless you’re hosting site from your own home server, most web hosts that you choose will give you the choice of either and you won’t have to actually install anything yourself.

If you are installing Apache and PHP by yourself, there are two main methods of accomplishing this. One can either install each separately, or use an automated script or installation program. Both are acceptable ways of installing the Apache HTTP server and PHP. In terms of security, it’s actually better to install PHP and Apache separately, but as long as you keep permissions set properly a program installation manager like XAMPP is perfectly safe. XAMPP is fairly common, and handles the installation of Apache, PHP and the MySQL database on a variety of operating systems.

The XAMPP package works equally well for both Windows and Linux. On Windows, it’s a simple matter of downloading the program, executing it, and choosing passwords during the install. However, there are a few additional steps that need to be taken with Windows 7 and Vista, such as switching the default IIS server of Microsoft’s system off of port 80 so that Apache can use that port. On the other hand, Linux installation is a bit simpler. You really just have to download the compressed XAMPP software package, extract it to the /opt directory, and that’s it. To start the server on a Debian server, you’d run “sudo /opt/lampp/lampp start”, and it fires up all components.

One advantage of a LAMP stack is that many Linux distributions can install PHP5, Apache2, MySQL as well as phpMyAdmin all with one single command from their software repositories. For instance, Ubuntu installs the whole shebang with the command “sudo apt-get install lamp-server^” from the command-line. All you have to do is choose a few passwords during the setup process. You can also install PHP and Apache separately through terminal commands and it takes about the same amount of time to get going. While it’s somewhat a matter of personal preference and the environment you’re used to, the Linux filesystem is easy to get a hang of.

There are a few metrics by which the relative merits of Windows versus Linux hosting can be judged. Speed, reliability, security and time spent configuring and administering the system are the main areas we want to consider. Windows has an edge in terms of usability on the desktop, but that doesn’t really extend to the server realm for most users as both Linux and Windows hosting solutions will offer graphical user interfaces. Linux is also faster and suffers fewer bugs and crashes.

Linux has a well deserved reputation for superior security, and in many cases it’s not necessary to install anti-virus software at the server level. Thanks to the locked down, modular nature of Unix-based systems, it’s difficult for a virus to infiltrate the system without the express permission of the administrator. In terms of ease of use, Linux isn’t as hard to pick up as it seems. Despite the reputation as an operating system for “nerds”, it’s quite well laid out and logical. There are fewer layers of abstraction which cuts down on code bloat, and the open source nature of Linux means vulnerabilities are spotted and corrected more quickly.

At the end of the day, running Apache and PHP on a Linux platform involves less hassle and cost, and is more reliable than on Windows. It also comes out on top in terms of security and safety, and costs less as it is free. As far as level of difficulty when it comes to installation, Linux has the edge. They’re both fairly easy overall, however. The real question is which operating system is the best choice for the long haul and will perform well under stress and be more impervious to malicious attacks. In that case, the best hosting environment for an Apache server with PHP is Linux.

This article has been penned down by Joanna and Steven who are part of from over 2 years and been in the web industry from quite some time now.

add RSS


New to Old.
  • Bee May 27, 2012
  • shcheuk
    Oct 17, 2011
  • Anon
    Nov 18, 2010
  • Jul 29, 2010


Write your comment here...

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>