Upgrade the PHP-FPM version on CentOS 7 with 3 steps.
During the process of installing and operating a server, if your server only supports a single fixed version of PHP, such as 5.6 or 7.3 and some software applications require a newer version of PHP to operate, then you need to upgrade the PHP version to serve the program. For example, if you want to install WooCommerce, your PHP version must be above PHP5.6, otherwise it will not work.
In this article, AZDIGI wants to guide you on how to upgrade the PHP version to serve your operations and usage. And if you are looking for a document on how to downgrade PHP-FPM, please see the link below. But now, let’s upgrade together.
II. Steps to upgrade the PHP-FPM version
To upgrade PHP-FPM, you perform sequentially with 3 steps:
Step 1: SSH into the system and check the version
To upgrade the PHP-FPM version on CentOS 7, you need to SSH into the server. If you don’t know how to SSH, please refer to the following article:
Because the installation steps will take a long time, to ensure safety, you should create a screen and run it on a backup screen in case of sudden shutdown or loss of internet connection.
After successfully SSHing into the server, check the current version to start the downgrade process. You can use the
php -v command to check the version from the Terminal window Alternatively, you can create the
info.php file in the source code storage directory with the following content.
Below is my actual illustration with the current version of PHP 7.3 and I will upgrade to PHP 7.4.
Step 2: Install EPEL Repo
Next, you should install the EPEL Repo. EPEL (Extra Packages for Enterprise Linux) is a community-driven and free repository of open-source software packages developed and maintained by Fedora. EPEL provides 100% high-quality software packages for Linux operating systems such as Redhat, CentOS, Fedora. To install it, we will download the RPM package and install it as follows:
- See also: Instructions for using RPM on Linux
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm yum install yum-utils
Step 3: Upgrade the PHP-FPM version
Next, to upgrade, you need to enable the Remi repository. Use the following command to enable it.
yum-config-manager --enable remi-phpXX
Note: Replace XX with the PHP version you need to upgrade. For example, I want to upgrade to
7.4 so I will enter
After enabling, use the
yum update -y command to start the process of upgrading the PHP-FPM version. This is the final and important step for the upgrade to take place. The upgrade process will not take much time and if you are running it in a screen as recommended in the first step, there is no need to worry.
yum update -y
After the “Complete” message appears, it means that the upgrade is complete. Please run the command
php -v again to check. Or you can check directly from the
info.php file that you created.
That’s it! With the above steps, you have successfully upgraded PHP-FPM on CentOS 7. Wishing you success! See more useful articles about Linux VPS at the following link:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 730 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: email@example.com .