Home WebServer PanelCentOS Web Panel How to change the PHP version CentOS Web Panel (CWP)

How to change the PHP version CentOS Web Panel (CWP)

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

In this article, AZDIGI will show you how to change the PHP version on CentOS Web Panel (CWP).

I. Overview of CWP (CentOS Web Panel)

By default, when we install CentOS Web Panel (CWP), CWP only installs the default PHP version of 5.6.

And the free version of CentOS Web Panel (CWP) also won’t support installing multiple versions of PHP simultaneously. So to use the feature of using multiple PHP versions and change PHP versions between different sites, you need to upgrade to the CWP PRO version, you can refer to the price at the following link:

And I will use the free version of CentOS Web Panel, so I will show you how to change the PHP version on free CentOS Web Panel.

II. Change the PHP version on CentOS Web Panel

To change the PHP version on CentOS Web Panel, we follow these 3 steps:

Step 1: SSH into your CentOS Web Panel system

To change the PHP version on the CentOS Web Panel, you need to SSH into the server to be able to see the new PHP installation progress. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:

After successfully SSH, we continue with step 2 to log in to CentOS Web Panel.

Step 2: Login to CentOS Web Panel

To log in to CentOS Web Panel, you need to access the following link on the browser.

AZDIGI Tutorial
https://IP:2031/
    

Remember to change the IP to the IP address of your CentOS Web Panel server.

Below is my CentOS Web Panel interface:

change-the-php-version-on-centos-web-panel
The CentOS Web Panel interface.

Next, you need to determine the current PHP version in use by selecting PHP Settings => PHP info as shown below:

change-the-php-version-on-centos-web-panel
The PHP info feature on CentOS Web Panel.

The screen will show the information table of the PHP version in use.

change-the-php-version-on-centos-web-panel
My currently installed PHP version on CentOS Web Panel is PHP 5.6.

As shown above, my currently installed PHP Version is PHP 5.6.

We continue to the next step to change the PHP CentOS Web Panel version to the latest PHP 7.4.

Step 3: Change the PHP version on CentOS Web Panel

To change the version of PHP on the CentOS Web Panel, you go to the PHP Settings => PHP Version Switcher feature as shown below:

change-the-php-version-on-centos-web-panel

At the right interface, let’s choose the PHP version we want to install. I will install the latest PHP version, PHP 7.4.

change-the-php-version-on-centos-web-panel

After selecting the version of PHP you need, the next step is to select the extensions that come with this PHP version. If you have no special needs, leave the default and scroll down to the bottom of the page and select Save & Build.

image 46

You will not be able to see the installation progress on the CentOS Web Panel interface. At this point, you will see a small message at the bottom of the page.

AZDIGI Tutorial
PHP Compiler Started in Background. You can monitor PHP rebuild from the console using command: tail -f /var/log/php-rebuild.log
    

So you need to go back to the SSH interface in step 1 and run the following command to monitor the installation of the new PHP version.

AZDIGI Tutorial
tail -f /var/log/php-rebuild.log
    

Below is my installation process:

change-the-php-version-on-centos-web-panel

Please wait about 15 minutes, my new PHP version has been installed, with more powerful servers, so this time can be much shorter.

image 50

You can check again as with step 2, you will see that the new PHP 7.4 version has been installed successfully. And all existing websites and future websites will run on this PHP version.

III. Summary

Thus, AZDIGI has completed the instructions on changing the PHP version on CentOS Web Panel. Using the latest version will help your website run faster, be compatible with the latest source code, and more importantly, help protect your website against security holes in the old version.

Hope this article will be of help to you. Wishing you success!

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign