How to Install PHP 8.3 on Ubuntu 22.04

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

ZBT Z8102AX Dual-SIM Failover: What Works, What Is Missing and What Needs Better Firmware
The ZBT Z8102AX is a dual-SIM 5G OpenWrt router, but dual-SIM hardware alone is not the same as intelligent failover. The router recognizes the SIM and connects successfully, but automatic switching, modem recovery, signal-based decisions and clean failover logic still need deeper testing.

Google I/O 2026: Antigravity, AI Studio, and the Shift to Agentic DevTools
Google I/O 2026 made one thing clear for engineers: AI tooling is moving beyond autocomplete into managed agentic execution. This article breaks down Antigravity 2.0, the expanding role of Google AI Studio, Gemini 3.5 Flash, and the real trade-offs around orchestration, lock-in, verification, and developer workflow design.

Enterprise-Grade Multi-Tenant Architecture for an International Platform
Loving Rocks is an enterprise-grade wedding platform designed with a true multi-tenant architecture, isolated databases per tenant, and built-in internationalization for global scalability, security, and long-term operational stability.

HEIC to JPG Conversion: Why You Should Consider It and How It Works
HEIC offers modern image compression and high quality, but JPG remains the most compatible format. This guide explains when and how to convert HEIC to JPG using Linux tools and automation.

ZBT Z8102AX Hardware and Packaging Review: Strong Router, Weak Box
The ZBT Z8102AX makes a solid first impression as a slim black metal 5G OpenWrt router with multiple antenna connectors, dual-SIM slots, USB, LAN/WAN ports and a practical accessory set. The hardware feels useful and serious, but the packaging is clearly the weak point.
installation-apache-solr-7-6-0-auf-ubuntu-18-04-lts-und-18-10

Ubuntu Graphics Stack Transition: Hybrid GPU Boot Crashes, Wayland Risks, and Stable Deployment Practices
Ubuntu desktop upgrades can trigger boot hangs, missing login sessions, and unstable rendering—especially on hybrid Intel + NVIDIA systems. This article explains the underlying graphics stack transition, why regressions happen, and how to deploy Ubuntu safely using LTS baselines and validated driver strategies.

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.

Should You Buy a 5G OpenWrt Router with Old Firmware? ZBT Z8102AX as a Practical Example
Buying a 5G OpenWrt router with older firmware can make sense, but only under the right conditions. The ZBT Z8102AX shows both sides clearly: the hardware is useful, the modem works, and the router stayed stable in testing, but OpenWrt 21.02, weak packaging and unclear upgrade paths require a careful buying decision.

Google I/O 2026: Architectural Pivots, Agentic AI, and the Unified Ecosystem Reality Check
Google I/O 2026 was not just a model event. It showed a deeper platform shift across Gemini models, developer tooling, Android-linked surfaces, and intelligent devices. This article breaks down the keynote as a hub story for engineers, architects, and product teams who need to separate real runtime implications from stage-level hype.
apache-ubuntu-17-10-install-certbot-lets-encrypt

Front- and Backend Development
Front-end and back-end development is an essential part of web development and involves the creation of web applications and websites. Front-end development focuses on the user interface, while back-end development is responsible for programming and managing the server side.