Upgrade PHP Version on openSUSE Leap 15
HOW TO UPGRADE PHP TO 8.x IN OpenSUSE 15
Overview: This article explains how to upgrade to latest php version on openSUSE Leap 15 by adding the official PHP repository, installing the desired PHP version, and verifying the installation.
OpenSUSE is a free and open-source Linux distribution developed by the openSUSE project. It is offered in two main variations: Tumbleweed, an upstream rolling release distribution, and Leap, a stable release distribution which is sourced from SUSE Linux Enterprise.
Step 1: Add PHP Repository for PHP 8.x packages and refreshes the package manager's data.
Run the following command
root@gateway:~# sudo zypper addrepo -f https://download.opensuse.org/repositories/devel:/languages:/php/openSUSE_Leap_15.4/ PHP-OpenSUSE
root@gateway:~# sudo zypper refresh
Step 2: Install PHP 8.x from the added repository: Adjust the package name accordingly based on what's available in the repository.
root@gateway:~# sudo zypper install php8-8.2.15-lp154.150.1.x86_64 (Replace with the required PHP version.)
root@gateway:~# sudo zypper install php8-8.4.24-lp156.1.1.x86_64 (Replace with the required PHP version.)
Step 3: Check the PHP Version. This should display the version of PHP you installed.
root@gateway:~# php -v
Related Articles:
