installphp.info


← Back to home page

Install PHP 8.3 on Debian 12

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 Debian 12

Prerequisites

  • Root access or sudo privileges on your Debian 12 system
  • Terminal access
  • Internet connection

Installation

  1. Update the package list:

    sudo apt update
  2. Install required dependencies:

    sudo apt install -y lsb-release ca-certificates apt-transport-https software-properties-common gnupg2
  3. Add the Ondřej Surý PHP repository:

    echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
  4. Import the repository's GPG key:

    wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
  5. Update the package list again:

    sudo apt update
  6. Install PHP 8.3:

    sudo apt install -y php8.3

Verification

  1. Check the installed PHP version:

    php -v
  2. Verify PHP configuration:

    php -i
  3. Create a test PHP file:

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

    http://your_server_ip/phpinfo.php