The LAMP Stack: Why Linux, Apache, MySQL and PHP Powered the Web
LAMP is the combination of Linux, Apache, MySQL and PHP that ran much of the early web. Learn where the term came from and why it still matters for hosting.
If you have ever installed WordPress, Joomla or Drupal, you used a LAMP stack, even if you never heard the word. LAMP stands for Linux, Apache, MySQL and PHP: an operating system, a web server, a database and a programming language, all free and open-source, and all designed to work together. The combination dominated website hosting from the late 1990s, and its descendants are still everywhere.
Where the term came from
The acronym is credited to Michael Kunze, who used it in an article in the German computer magazine c't in 1998. His point was that a set of free tools could compete with commercial server platforms. The P was flexible from the start: it could also mean Perl or Python, which were common scripting languages for the web at the time. In practice, PHP became the usual choice.
The four parts
Linux
The operating system provides the foundation. Linux, started by Linus Torvalds in 1991, was free to download and ran on inexpensive hardware, which let small companies run servers without buying a commercial Unix licence.
Apache
The web server receives requests from browsers and sends back pages. Apache, released from 1995, was the most widely used web server and was modular enough to run PHP code through a module.
MySQL
The database stores structured information such as posts, products and users. MySQL, first released in 1995 by the Swedish company MySQL AB, was fast and simple, which suited websites that did far more reading than writing.
PHP
The language that generates pages dynamically. A PHP file can read from the database and produce HTML for each visitor. It was easy to learn and easy to deploy: you put the file on the server and it ran.
Why LAMP won
- Cost. Every component was free, so only the hardware and the person's time had to be paid for.
- Ease of deployment. To publish a dynamic site, you copied files to a directory.
- A shared-hosting fit. Hosting companies could run thousands of small sites on one machine with this stack.
- A growing ecosystem. Open-source applications built for LAMP, such as phpBB forums, MediaWiki and later WordPress, gave new users ready-made software.
- Documentation and community. Because so many people used it, answers to common problems were easy to find.
Large sites were also built on it. Wikipedia's software, MediaWiki, is written in PHP and uses a database, and Facebook started as a PHP application, although both later customised their technology extensively.
Variations on the stack
| Name | Differences |
|---|---|
| LEMP | Nginx replaces Apache (pronounced "engine-x") |
| WAMP / MAMP | Windows or Mac versions, common for local development |
| LAMP with MariaDB | MariaDB, a MySQL fork, replaces MySQL |
| MEAN / MERN | JavaScript-based stacks with MongoDB, Express, Angular or React, and Node.js |
Is LAMP outdated?
Not really. Newer stacks have become popular, and many developers now work with Node.js, Python frameworks or containers. But a very large share of websites still run on PHP and a relational database, mainly because of content management systems like WordPress. Modern PHP versions are much faster and more capable than the PHP of the 1990s. The basic idea of a web server, an application language and a database is the same in all of them.
Practical points for your site
- Keep PHP updated. Old PHP versions stop receiving security fixes.
- Back up the database as well as the files, since your content lives in both.
- Use a staging copy to test updates before you apply them to a live site.
- If you use a plugin or theme that requires a specific PHP version, check this before you upgrade.
The weaknesses of the early stack
The LAMP era was not without problems. Early PHP applications mixed code and presentation in the same file, and many were written without attention to security, which led to a long history of vulnerabilities such as SQL injection. Shared servers often ran every site under the same user account, so one compromised site could affect the others. Modern hosting reduces these risks by separating accounts, applying updates quickly and running tools such as web application firewalls. Even so, the best protection remains simple habits: keep software updated, use strong passwords and remove plugins and themes you do not use. Our security page describes how we approach this on the server side.
Version management is another part of the story. Each component of the stack has its own release cycle, and falling far behind on any of them creates risk. A well-run host keeps the operating system, web server and database patched, and lets you pick a supported PHP version per site, so that you can upgrade at a pace that suits your applications.
LAMP and your hosting plan
You do not need to install the stack yourself. On a Zebra Hosting plan, the Plesk control panel lets you choose the PHP version, create databases and manage the web server through a web interface. For sites built on WordPress, our WordPress hosting is designed for exactly this stack, and if you want to run your own software and tune everything, a VPS gives you full control.