How to Install PHP 8.3 on Ubuntu 22.04

Up-to-date guide on installing PHP 8.3 on Ubuntu 22.04, including Apache and Nginx (PHP-FPM) integration, extensions, and running multiple PHP versions side by side.
Published:
Aleksandar Stajić
Updated: January 9, 2026 at 12:16 AM
How to Install PHP 8.3 on Ubuntu 22.04

Illustration

How to Install PHP 8.3 on Ubuntu 22.04

This guide shows how to properly install and run PHP 8.3 on Ubuntu 22.04 in a modern server environment. It covers system preparation, repository setup, Apache and Nginx integration, PHP extensions, version switching and common best practices.

Step 1: Update the Operating System

Before installing PHP, make sure your system is fully up to date. This prevents dependency conflicts and ensures security patches are applied.

sudo apt update && sudo apt upgrade -y

Step 2: Add the PHP Repository

Ubuntu 22.04 does not ship PHP 8.3 by default. The widely used and trusted Ondřej Surý repository provides up-to-date PHP versions and extensions.

sudo apt install -y ca-certificates apt-transport-https software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

Step 3: Install PHP 8.3 (CLI)

Install the PHP 8.3 core package. This provides the PHP CLI and the base runtime required by web servers and background tasks.

sudo apt install -y php8.3

Verify the installed PHP version:

php -v

Step 4: Install PHP 8.3 for Apache

If you are using Apache, install PHP as an Apache module. This setup is common for traditional LAMP stacks.

sudo apt install -y libapache2-mod-php8.3

Restart Apache to activate the PHP module:

sudo systemctl restart apache2

Step 5: Install PHP 8.3 FPM for Nginx

For Nginx-based setups, PHP must run via PHP-FPM. This approach offers better performance and scalability.

sudo apt install -y php8.3-fpm

Check that the PHP-FPM service is running:

systemctl status php8.3-fpm

Step 6: Install Common PHP Extensions

Most applications require additional PHP extensions. Install only what your project actually needs to keep the system lean and secure.

sudo apt install -y php8.3-mysql php8.3-curl php8.3-xml php8.3-mbstring php8.3-zip php8.3-intl php8.3-gd php8.3-opcache

List all loaded PHP modules:

php -m

Step 7: Run Multiple PHP Versions Side-by-Side

Ubuntu allows multiple PHP versions to coexist. This is useful when maintaining legacy applications while deploying new projects on PHP 8.3.

sudo update-alternatives --config php

You can also set a specific PHP version directly:

sudo update-alternatives --set php /usr/bin/php8.3

Step 8: Recommended Post-Installation Checks

After installation, it is recommended to verify PHP configuration files, confirm the correct PHP-FPM socket or port for your web server, and ensure OPcache is enabled for production environments.

For production systems, always review php.ini settings such as memory limits, execution time, upload size and error handling according to your application requirements.

Conclusion

Installing PHP 8.3 on Ubuntu 22.04 provides a modern, stable and performant foundation for web applications. Whether you run Apache or Nginx, a clean PHP setup with the right extensions and version management ensures long-term maintainability and smooth operation.

Related Articles

Database Marketing – Modern Approach for Customer Relationships

Database Marketing – Modern Approach for Customer Relationships

Modern overview of database marketing: from data strategy and technical architecture to automation, GDPR and best practices for sustainable customer relationships.

Streamlining Code Quality: Testing with ESLint and Prettier

Streamlining Code Quality: Testing with ESLint and Prettier

This article details the integration of ESLint and Prettier into modern development and testing workflows, focusing on practical implementation for consistent code quality and style.

erstellen-eines-benutzerdefinierten-gpt-4-plugins-in-wordpress

erstellen-eines-benutzerdefinierten-gpt-4-plugins-in-wordpress

Techniques for creating SHA512 password hashes with doveadm

Techniques for creating SHA512 password hashes with doveadm

Detailed guide for securely generating SHA512 password hashes from the command line using the Dovecot tool doveadm. This article is intended for system administrators and developers.

Laravel 12 Custom CMS with Filament 3: The Expert Workflow

Laravel 12 Custom CMS with Filament 3: The Expert Workflow

A detailed look at the synergies between Laravel 12 and Filament 3 for creating customized Content Management Systems. Experts analyze the innovative workflow, advantages, disadvantages, and the challenge of the Jetstream workflow.

force-install-package-in-virtualenv

Welcome to NuxtWP Multilang Theme

Welcome to NuxtWP Multilang Theme

Introduction to the NuxtWP Multilang Theme - a modern multilingual CMS built with Nuxt 4.

Convert MOV to MP4 Using FFmpeg: A Simple Guide

Convert MOV to MP4 Using FFmpeg: A Simple Guide

Learn how to convert MOV videos to MP4 using FFmpeg with reliable commands, batch processing, and quality optimization for web, streaming, and cross-platform compatibility.

Comprehensive Guide to Test DEv Enterprise Stajic.de: Architecture and Best Practices

Comprehensive Guide to Test DEv Enterprise Stajic.de: Architecture and Best Practices

Explore the architectural principles, benefits, and technical details of managing an enterprise-grade development and testing environment with Test DEv Enterprise Stajic.de.

tensorflow

tensorflow

Search Engine Optimization: The reliable workflow for Top-Rankings

Search Engine Optimization: The reliable workflow for Top-Rankings

Detailed analysis of search engine optimization (SEO), its technical foundations, the role of web crawlers, and the strategic steps to achieve organic top rankings.

Mastering the SEO Workflow: Essential Optimization Strategies for Organic Growth

Mastering the SEO Workflow: Essential Optimization Strategies for Organic Growth

A structured SEO workflow is crucial for sustainable organic growth. Learn the ten foundational strategies, from keyword research and technical optimization to content quality and performance analysis.