installphp.info


← Back to home page

Install PHP 8.3 on Ubuntu 22.04

This version of PHP is actively supported.

Good news! PHP 8.3 is being actively supported through 31 Dec 2025. After that point, it's advisable to upgrade to the latest version, since the PHP team will only offer security-related support until 31 Dec 2027, at which point PHP 8.3 will be considered "end-of-life".

Installing PHP 8.3 on Ubuntu 22.04

Prerequisites

  • Ubuntu 22.04 LTS installed and updated
  • Root or sudo access to the system
  • Terminal access
  • Internet connection

Installation

  1. Add the Ondřej Surý PPA repository:

    sudo add-apt-repository ppa:ondrej/php
  2. Update the package list:

    sudo apt update
  3. Install PHP 8.3 and common extensions:

    sudo apt install php8.3 php8.3-cli php8.3-common php8.3-curl php8.3-mbstring php8.3-mysql php8.3-xml

Verification

  1. Check the installed PHP version:

    php -v

    This should display information about PHP 8.3.

  2. Verify installed modules:

    php -m

    This will list all installed PHP modules.

  3. Create a PHP info file:

    echo '<?php phpinfo();' > /var/www/html/info.php

    Access this file through your web browser to see detailed PHP configuration information.