Does WordPress run under PHP?

Yes 👍 — WordPress runs primarily on PHP.

How it works

  • PHP: WordPress core is written in PHP. When a visitor loads a page, the web server runs PHP scripts that generate the page content.
  • Database: Content (posts, pages, settings) is stored in a MySQL or compatible database such as MariaDB.
  • Web server: Typically hosted on servers like Apache HTTP Server or Nginx that execute the PHP code.

Simplified flow

  1. Browser requests a page from WordPress.
  2. The server runs the PHP code.
  3. PHP retrieves content from MySQL/MariaDB.
  4. PHP generates HTML.
  5. The HTML is sent back to the browser.

Typical hosting stack

A common setup is the LAMP stack:

  • Linux
  • Apache
  • MySQL / MariaDB
  • PHP

There are also variants like LEMP (Linux + Nginx + MySQL + PHP).

Minimum install steps, if you are thinking of running WordPress locally (for example on a Raspberry Pi or Linux machine):🚀

Here is a simple way to run WordPress locally on Linux (works well on Raspberry Pi, Ubuntu, Debian, etc.). This uses the classic LAMP stack.


1. Install the LAMP stack

Install the web server, database, and PHP.

sudo apt update
sudo apt install apache2 php libapache2-mod-php php-mysql mysql-server unzip

This installs:

  • Apache HTTP Server
  • PHP
  • MySQL

Start and enable services:

sudo systemctl enable apache2
sudo systemctl start apache2

Test Apache by visiting:

http://localhost

You should see the Apache test page.


2. Create the WordPress database

Log into MySQL:

sudo mysql

Create database and user:

CREATE DATABASE wordpress;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

3. Download WordPress

Download the latest version of WordPress:

cd /tmp
wget https://wordpress.org/latest.zip
unzip latest.zip

Move it to the web directory:

sudo mv wordpress /var/www/html/

Set permissions:

sudo chown -R www-data:www-data /var/www/html/wordpress

4. Configure WordPress

Copy the configuration template:

cd /var/www/html/wordpress
cp wp-config-sample.php wp-config.php

Edit it:

nano wp-config.php

Set the database values:

DB_NAME     wordpress
DB_USER     wpuser
DB_PASSWORD password
DB_HOST     localhost

5. Run the installer

Open your browser:

http://localhost/wordpress

Follow the setup wizard to create your site admin.


✅ After this you have a fully working WordPress server locally.


By Admin

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.