Home WebServer PanelCyberPanel How to change Cyber Panel’s default PHP version

How to change Cyber Panel’s default PHP version

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

When you install CyberPanel, by default, CyberPanel developers will install their default PHP version on the operating system which is PHP 7.1 version. Many users may confuse this PHP version with a custom PHP version to run the website, but the two versions are completely different.

To customize the PHP version for websites, you can refer to the instructions below (currently, CyberPanel has customized PHP up to version 7.4)

So how to change the default PHP version of CyberPanel, then in this article AZDIGI will guide you on how to change this default PHP version, you can see the steps below.

Implementation guide

Step 1: Check the current default PHP version of the VPS

To check the default version, you need to SSH into the VPS as root, if you don’t know how to SSH into the VPS, you can refer to the article below:

After SSH into the VPS, you can check the PHP version of the currently running VPS by using the command:

AZDIGI Tutorial
php -v    
image 26

As shown above, currently this VPS is using PHP version 7.1.

Step 2: Determine of location the PHP file

To determine the path of this PHP file, use the command:

AZDIGI Tutorial
which php  
image 28

So the path containing the PHP file is located at /usr/bin/php

Step 3: Change the PHP version

In this step, copy the lsphp version to replace /usr/bin/php (the system’s default PHP version) with the following command:

AZDIGI Tutorial
cp /usr/local/lsws/lsphp74/bin/lsphp  /usr/bin/php    

(74 is the new PHP version I want to upgrade, if you want to change 7.2 or 7.3 please replace it with 72 and 73).

When running the command, the system will ask if you want to overwrite the current PHP version, press Y to agree.

image 29

So the upgrade process is complete. To check if the version you just changed has been successful, run the php -v command again to see the PHP version after the upgrade.

image 30

The PHP version has been changed completely from 7.1 to 7.4.

Summary

Thus, AZDIGI has completed the steps to change the default PHP version of Cyber Panel in a simple way with only one command line. This PHP change will be suitable in cases where you need to install some extensions and scripts on VPS and requires a separate PHP version to work. Hope the article is helpful to you. Wishing you success!

Reference articles:

Wishing you success!

If you need assistance, you can contact support in the ways below:

Đá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