Glossary · Cloud & Hosting

LAMP Stack

The LAMP stack is a classic web application platform made of Linux, Apache, MySQL (or MariaDB) and PHP (or Perl or Python).

Updated October 6, 2026

The LAMP stack is a combination of open-source software for hosting dynamic websites: Linux as the operating system, Apache as the web server, MySQL or MariaDB as the database, and PHP as the programming language. Perl and Python are sometimes counted in the final letter.

Why it matters

LAMP is the foundation of a huge number of websites, including most WordPress installations and many shared hosting plans. It is well documented, inexpensive and supported by control panels. When a site shows "Error establishing a database connection" or a blank page, knowing which layer failed (Apache, PHP or the database) narrows the cause quickly.

A request flows through the layers in order: Apache receives it, hands PHP files to the PHP handler, PHP queries the database, and the result becomes HTML.

Example

sudo apt install apache2 mariadb-server php libapache2-mod-php php-mysql
systemctl status apache2 mariadb

Place a file at /var/www/html/info.php containing <?php phpinfo(); to test PHP, then delete it, because it exposes server details.

Common mistakes

  • Running the database and web server on one small machine with no memory limits.
  • Leaving a test file such as phpinfo.php publicly available.
  • Using default database passwords.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

This page is general information written by our editorial team and updated when documentation changes. Servers and providers differ, so test changes safely first. See our editorial policy and disclaimer.