In the dynamic world of web development and server administration, keeping your software up to date is essential for ensuring security, performance, and compatibility. The release of AlmaLinux 9.3 and PHP 8.2 represents significant updates in the realm of server operating systems and web development languages, respectively. This post will give you a concise overview of what AlmaLinux 9.3 and PHP 8.2 bring to the table, followed by a guide on how to upgrade to PHP 8.2 on an AlmaLinux 9.3 system without removing your existing PHP installation.

AlmaLinux 9.3 in Brief
AlmaLinux OS is a free, open-source, community-supported enterprise Linux distribution, designed to be a drop-in replacement for CentOS. As a 1:1 binary compatible fork of RHEL (Red Hat Enterprise Linux), AlmaLinux offers a secure, stable, and high-performance solution for enterprise environments. The release of AlmaLinux 9.3 introduces updated packages and security improvements, enhancing server robustness and reliability. It also boasts better hardware support and advancements in containerization and virtualization technologies.
Introducing PHP 8.2
PHP 8.2 introduces several new features and improvements that aim to optimize the language’s functionality, security, and efficiency. Highlights include readonly classes, disjunctive normal form types, and new random number functions. PHP 8.2 also focuses on security enhancements by deprecating dynamic properties and encouraging better coding practices. Upgrading to PHP 8.2 can lead to significant improvements in web application performance and security.
How to Upgrade to PHP 8.2 on AlmaLinux 9.3
Upgrading your PHP version should be approached with care, ensuring your website and database are backed up to prevent any loss of data. Here’s how to upgrade PHP to version 8.2 on AlmaLinux 9.3 without removing your existing PHP version.
Step 1: System Preparation
Log into your AlmaLinux server with SSH as the root user or as a user with sudo privileges. Begin by updating your system packages to the latest versions available:
sudo dnf update -y
Step 2: Enable Remi Repository
To access PHP 8.2, you’ll need to enable Remi’s repository, a well-maintained third-party repository by Remi Collect:
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm
Step 3: Install PHP 8.2
Instead of removing the existing PHP version, we will simply install PHP 8.2 alongside it. First, reset the PHP module to avoid conflicts with the version provided by AlmaLinux’s base repository:
sudo dnf module reset php -y
Next, enable the PHP 8.2 module stream from Remi’s repository:
sudo dnf module enable php:remi-8.2 -y
Now, proceed to install PHP 8.2. You can include common extensions that are often needed:
sudo dnf install php php-common php-mysqli php-cli php-fpm php-mysqlnd php-zip php-devel php-gd php-mcrypt php-mbstring php-curl php-imap php-exif php-xml php-xmprpc php-pear php-bcmath php-json php-pgsql php-fileinfo php-gmp php-iconv php-intl php-openssl php-soap -y
Step 4: Verify PHP Upgrade
After the installation, verify that PHP 8.2 is correctly installed on your system:
php -v
This command should output the PHP version, confirming that PHP 8.2 is now active.
Conclusion
Upgrading to PHP 8.2 on AlmaLinux 9.3 enhances your server’s capabilities by leveraging the latest features and security improvements. Following the steps above allows for a smooth upgrade process, ensuring that your applications remain compatible and secure. Remember, always back up your data before proceeding with significant updates like this to safeguard against potential issues.