Home WebServer PanelDirectAdmin Install PHP 7.4 into CentOS 6 on DirectAdmin

Install PHP 7.4 into CentOS 6 on DirectAdmin

by
Published: Last Updated on
A+A-
Reset

In this tutorial, AZDIGI will guide you to install PHP 7.4 into CentOS 6 on DirectAdmin and can be applied to PHP 8.0.

I. Introduction

Why did I previously write a tutorial on installing multiple versions of PHP on DirectAdmin and an article on installing PHP 8.0 on DirectAdmin, but now I have this article? Then I would like to explain more that these tutorials are all installed on CentOS 7, so installing new PHP versions like 7.4 or 8.0 is completely simple, but with CentOS 6 isn’t that simple.

And certainly, if you follow those instructions on CentOS 6, you will encounter many errors. In this article, I will help you debug each error and be able to install PHP 7.4 into CentOS 6 in DirectAdmin.

II. Install PHP 7.4 into CentOS 6 on DirectAdmin

To install PHP 7.4 into CentOS 6 on DirectAdmin, we need to perform the following steps.

Step 1: SSH into your server

To install PHP 7.4 into CentOS 6 on DirectAdmin, we first need to SSH or access your VPS/server with root privileges. 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 check the version of CustomBuild in use.

Step 2: Check the Custombuild version

First, check if your VPS/Server is using CustomBuild 2.0 version. To check the version of CustomBuild you are using, please check out the following short tutorial:

In case your CustomBuild version is lower than 2.0 then you need to upgrade CustomBuild 1.x to 2.0 , you can check out the following tutorial:

After having CustomBuild 2.0, we go to step 3 to execute the command to change the current PHP version to version 7.4.

Step 3: Change the current PHP version to PHP 7.4

My VPS only uses 1 version of PHP 7.3, so I will use the following command to upgrade.

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild
./build set_fastest
./build update
./build set php1_release 7.4
    

In case you want to use multiple versions of PHP like 5.6 and 7.4, in which version 7.4 is the default version, you use the command below (because many old source codes can only run with PHP 5.6)

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild
./build set_fastest
./build update
./build set php1_release 7.4
./build set php1_release 5.6
    

If you want to use 3 or 4 PHP versions, then do the same and only DirectAdmin version 1.50.1 and above supports 4 PHP versions only.

After the configuration is complete, we execute the following command to start the process of installing PHP 7.4 into CentOS 6 on DirectAdmin with the following command:

AZDIGI Tutorial
./build php n
    

Sure, you will encounter errors during this installation, but don’t worry. We continue to see the article to know what these errors are and how to fix them.

III. Common errors when installing PHP 7.4 into CentOS 6 on DirectAdmin

Usually, when installing PHP 7.4 into CentOS 6 on DirectAdmin, we encounter 1 of the following 3 errors or sometimes all 3.

Error 1: cmake3: command not found

The error will have the following content:

AZDIGI Tutorial
Cannot find cmake, installing it...
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: ***
* extras: ***
* updates: ***
No package cmake3 available.
Error: Nothing to do
Found /usr/local/directadmin/custombuild/libzip-1.5.2.tar.gz
Extracting ...
Done.
Configuring libzip-1.5.2...
./custombuild/build: line 14579: cmake3: command not found
Done. Making libzip-1.5.2...
Trying to make libzip...
make: *** No targets specified and no makefile found. Stop.
    

When you get this error, you just need to install cmake and everything is solved. To install cmake, you execute the following command:

AZDIGI Tutorial
yum -y install cmake
    
install-php-74-into-centos-6-on-directadmin
Install cmake on CentOS 6.

You can then try to reinstall PHP 7.4 with the following command:

AZDIGI Tutorial
./build php n
    

Error 2: configure: error: Problem with libjpeg.(a|so). Please check config.log for more information

With this error, you just need to reinstall the libjpeg library with the command:

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild
./build libjpeg
    

You can then try to reinstall PHP 7.4 with the following command:

AZDIGI Tutorial
./build php n
    

Error 3: Requested icu-uc 50.1 but version of icu-uc is X.X

install-php-74-into-centos-6-on-directadmin

With this error, AZDIGI has written a very detailed tutorial, you can refer to the link below:

When you encounter this error, you just need to update the ICU to the latest version with the following commands:

AZDIGI Tutorial
cd /usr/local/directadmin/custombuild
./build update
./build icu
    

You can then try to reinstall PHP 7.4 with the following command:

AZDIGI Tutorial
./build php n
    

At this point, you can install PHP 7.4 into CentOS 6 on DirectAdmin successfully. And after you have finished building the PHP versions, don’t forget to restore the configuration to default with the following command:

AZDIGI Tutorial
./build rewrite_confs
    

IV. Summary

Hopefully, through this article, you have learned how to install PHP 7.4 into CentOS 6 on DirectAdmin successfully by handling the necessary conditions on VPS using CentOS 6. However, because CentOS 6’s support life cycle has ended, you should not continue to use CentOS 6 anymore but upgrade to the latest CentOS 7 or CentOS 8 for longer-term support.

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

See more useful articles about DirectAdmin at the following link:

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