Traditional web: PHP, Apache and MySQL (the LAMP stack)
How a classic dynamic website works: Apache (web server), PHP (language), MySQL (database). The LAMP stack that powers WordPress and a large part of the web.
This is the historic architecture of the dynamic web, and it still runs an enormous part of all websites — starting with WordPress. Understanding the LAMP stack means understanding how a “classic” site builds its pages.
LAMP at a glance
LAMP is the acronym of four building blocks that work together:
| Letter | Block | Role |
|---|---|---|
| L | Linux | The server’s operating system |
| A | Apache | The web server (receives and responds) |
| M | MySQL | The database |
| P | PHP | The language that builds the pages |
Apache — the web server
Apache is the program that listens for browser requests (on ports 80 and 443), then returns a response. For a static page, it serves the file directly. For a dynamic page, it hands off to PHP, retrieves the HTML produced, and sends it to the visitor.
A very common alternative: Nginx, often preferred for its lightness. The role is the same: being the site’s front door.
PHP — the language that builds the page
PHP is a server-side language: it runs on every request. Its job: receive the request, fetch the right data, and assemble the HTML to return.
This is what lets a site be different for each visitor or at every moment (a cart, an account, comments). Modern PHP (version 8) is also far faster than its 2000s reputation.
MySQL — the site’s memory
MySQL (or its cousin MariaDB) is a relational database: it stores information in tables (articles, users, orders…) and lets you retrieve it through the SQL language.
When you write an article in WordPress, it is stored in MySQL. When a visitor opens it, PHP fetches it and builds the page.
The journey of a WordPress page
- The browser requests a page from Apache.
- Apache hands the request to PHP (the heart of WordPress).
- PHP queries MySQL to retrieve the content.
- PHP assembles the HTML and returns it to Apache.
- Apache sends it to the browser.
All in a fraction of a second — and repeated on every visit (hence the value of caching to go faster).
When LAMP is the right choice
- Lots of content edited by non-technical people (admin interface).
- A need for a mature ecosystem (WordPress and its thousands of plugins).
- Shops (WooCommerce), magazines, content-rich association sites.
Things to watch out for
- Security & maintenance: more blocks = more to update and to back up. An unmaintained plugin is an open door.
- Performance: without caching, a dynamic site recomputes each page; it’s slower than a static site.
- Hosting: shared hosting is enough to get started; a VPS gives more control.
LAMP is neither “outdated” nor “the only way”: it’s a solid building block, to be chosen when content management matters more than raw performance.
Test your knowledge
In the LAMP stack, the role of Apache is…
Apache is the web server: it listens on port 80/443, receives HTTP requests and returns the response (often generated by PHP).
PHP runs…
PHP is a server-side language: it runs on every visit, fetches data and builds the HTML sent to the browser.
MySQL (or MariaDB) is used to…
MySQL is a relational database: it arranges data into tables and lets you retrieve it through SQL queries.
Which very widespread CMS is built on LAMP?
WordPress is written in PHP and uses MySQL; it powers a large share of the world's web.
One thing to watch out for with a dynamic site compared to a static site:
Server + language + database = more surface to update and back up. That's the price of flexibility.