Linux Standalone PHP

Table of contents

  1. Overview
  2. Install System Dependencies
  3. Install PHP 8.4
  4. Install Composer
  5. Install Node.js & NPM
  6. Project Setup

1. Overview Table of Contents

This guide walks through setting up your the Chappy.php framework on Ubuntu (22.04 LTS), Debian (LMDE), and RHEL (Rocky Linux 9) based distributions without requiring XAMPP, Nginx, or Apache. The framework is self-hosted using PHP’s built-in development server (php console serve).

Requirements

  • PHP 8.4
  • Composer
  • Node.js & NPM
  • Git (for cloning the repository)


2. Install System Dependencies Table of Contents

First, update your system and install essential dependencies:

Debian (LMDE)

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget git unzip

RHEL

sudo dnf update -y
sudo dnf install -y curl wget git unzip

Ubuntu

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget git unzip software-properties-common


3. Install PHP 8.4 Table of Contents

A. Debian (LMDE)**

1. Add the SURY repository (trusted PHP repo for Debian)

sudo apt install -y lsb-release apt-transport-https ca-certificates wget gnupg2

Then import the GPG key:

wget -qO - https://packages.sury.org/php/apt.gpg | sudo tee /etc/apt/trusted.gpg.d/php.gpg >/dev/null

Now add the repo to your sources list:

echo "deb https://packages.sury.org/php/ bookworm main" | sudo tee /etc/apt/sources.list.d/php.list


2. Update and install PHP 8.4

sudo apt update && sudo apt upgrade -y
sudo apt install -y php8.4 php8.4-cli php8.4-mbstring php8.4-xml php8.4-curl php8.4-zip php8.4-sqlite3 php8.4-bcmath


B. RHEL

sudo dnf install -y epel-release
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
sudo dnf module list php                    # List available PHP modules
sudo dnf module enable php:remi-8.4 -y      # Enabled PHP 8.3 from Remi repo
sudo dnf install -y php php-cli php-mbstring php-xml php-curl php-zip php-sqlite3 php-bcmath


C. Ubuntu

sudo add-apt-repository ppa:ondrej/php -y
sudo apt update && sudo apt upgrade -y
sudo apt install -y php8.4 php8.4-cli php8.4-mbstring php8.4-xml php8.4-curl php8.4-zip php8.4-sqlite3 php8.4-bcmath


Verify installation:

php -v


4. Install Composer Table of Contents

Composer is required to manage PHP dependencies.

1: Download and Install Composer

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

2: Verify Installation

composer -v


5. Install Node.js & NPM Table of Contents

Use NodeSource to install the latest stable Node.js version.

1: Add Node.js Repository

Debian (LMDE) and Ubuntu

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -

RHEL

curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -


2: Install Node.js & NPM

Debian (LMDE) and Ubuntu

sudo apt install -y nodejs

RHEL

sudo dnf install -y nodejs


3: Verify Installation

node -v
npm -v


6. Project Setup Table of Contents

Navigate to your preferred development directory and clone the project:

1. Cloning The Project

mkdir repos
cd repos/
git clone git@github.com:chapmancbVCU/chappy-php.git
cd chappy-php/


2. Install

Run:

composer run install-project


3. Run Project

  • A. Run:
    php console serve
    
  • B. Navigate to http://localhost:8000