2025-05-19 ============================================================================== Version Before Upgrading to v8.3 ------------------------------------------------------------------------------ Server API: FPM/FastCGI PHP Version 8.1.27 user@php80ub20:~$ php -v PHP 8.1.27 (cli) (built: Dec 21 2023 20:19:26) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.27, Copyright (c) Zend Technologies with Zend OPcache v8.1.27, Copyright (c), by Zend Technologies ============================================================================== ============================================================================== ChatGPT Session ------------------------------------------------------------------------------ How do I install the latest PHP to an ubuntu server? ------------------------------------------------------------------------------ Here’s the standard, reliable way admins keep an Ubuntu box on the newest PHP release (works for 20.04 LTS, 22.04 LTS, and newer): bash Copy Edit # 1. Update package lists & basic tools sudo apt update sudo apt install -y software-properties-common ca-certificates lsb-release apt-transport-https curl # 2. Add Ondřej Surý’s PHP PPA – he maintains the up-to-date builds sudo add-apt-repository ppa:ondrej/php # 3. Refresh and install the current stable version (today that’s 8.3) sudo apt update sudo apt install -y php8.3 # 4. (Optional) pull in common extensions you’ll probably need sudo apt install -y php8.3-{cli,fpm,common,mbstring,xml,zip,curl,gd,intl,bcmath,pgsql,mysql} # 5. Make sure the new PHP is the one in use php -v # should read “PHP 8.3.x …” which php # usually /usr/bin/php ------------------------------------------------------------------------------ If you’re running PHP-FPM with Nginx or Apache: # Enable the new FPM pool sudo systemctl restart php8.3-fpm # Apache: switch the module & restart sudo a2dismod php7.4 # disable old, adjust version if different sudo a2enmod php8.3 sudo systemctl restart apache2 ============================================================================== ============================================================================== After Installation ------------------------------------------------------------------------------ auser@php80ub20:~$ php -v PHP 8.3.21 (cli) (built: May 9 2025 06:26:54) (NTS) Copyright (c) The PHP Group Zend Engine v4.3.21, Copyright (c) Zend Technologies with Zend OPcache v8.3.21, Copyright (c), by Zend Technologies ------------------------------------------------------------------------------ Server API FPM/FastCGI PHP Version 8.3.21 ==============================================================================