/læmp/

n. “The classic web stack that lights up the internet.”

LAMP is an acronym for a widely used web development stack consisting of Linux (operating system), Apache (web server), MySQL (database), and PHP (programming language). Sometimes, variants substitute Perl or Python for PHP, but the core concept remains the same: a complete environment for developing and deploying dynamic websites and applications.

Each component of LAMP serves a specific role:

  • Linux: Provides a stable and secure foundation for running the stack.
  • Apache: Serves web pages over HTTP/HTTPS and handles requests from clients.
  • MySQL: Stores and manages application data with relational structure.
  • PHP: Processes dynamic content, executes server-side logic, and interacts with the database.

The LAMP stack became the backbone of early web applications because of its open-source nature, ease of deployment, and strong community support. It enabled developers to build interactive websites, forums, e-commerce platforms, and content management systems without expensive proprietary software.

Here’s a simple example showing how LAMP components interact using PHP to query a MySQL database:

<?php
$servername = "localhost";
$username = "root";
$password = "password";
$dbname = "mydb";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

// Query the database
$sql = "SELECT username FROM users WHERE id = 1";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
echo "Username: " . htmlspecialchars($row["username"]);
}
} else {
echo "0 results";
}

$conn->close();
?>

This snippet demonstrates PHP interacting with MySQL on a Linux server via Apache — the core of a LAMP application.

In essence, LAMP represents simplicity, accessibility, and the open-source ethos of web development. It remains a foundation for countless websites and educational projects, and it has inspired many modern stacks such as LEMP (Linux, Nginx, MySQL, PHP) and MEAN (MongoDB, Express, Angular, Node.js).