installphp.info


← Back to home page

Install PHP 8.2 on Ubuntu 23.10

This version of PHP is actively supported.

Good news! PHP 8.2 is being actively supported through 31 Dec 2024. 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 2026, at which point PHP 8.2 will be considered "end-of-life".

Installing PHP 8.2 on Ubuntu 23.10

Prerequisites

  • Ubuntu 23.10 (Mantic Minotaur) installed and updated
  • Terminal access with sudo privileges
  • Internet connection for downloading packages

Installation

  1. Update the package list:

    sudo apt update
  2. Install PHP 8.2 and common extensions:

    sudo apt install php8.2 php8.2-cli php8.2-common php8.2-curl php8.2-mbstring php8.2-mysql php8.2-xml
  3. Install additional extensions as needed:

    sudo apt install php8.2-gd php8.2-zip php8.2-bcmath

Verification

  1. Check the PHP version:

    php -v

    You should see output indicating PHP 8.2.x is installed.

  2. Verify installed extensions:

    php -m

    This will list all installed PHP modules.

  3. Create a test PHP file:

    echo '<?php phpinfo();' > /var/www/html/info.php
  4. Access the file in your web browser:

    http://your_server_ip/info.php

    You should see the PHP information page with details about your installation.