HowTo - Upgrade PHP

Upgrading the PHP version of DirectAdmin is pretty easy, we are going to upgrade it with the CLI interface it is also possible to use the Panel itself but there is a separate manual for this.

 

Connecting to your VPS

To begin the upgrade of your PHP version we first need to connect to the VPS.
You can use the Video Display in MyTilaa or connect to your VPS with SSH.

ssh root@<ip address>

mceclip0.png

 

Checking the version of Custombuild

Because DirectAdmin is pushing a lot of updates unknown to the public, it’s always good to upgrade the custombuild tool. With this tool we can upgrade different kind of things from DirectAdmin that they don’t update by default. We will start by going to the correct folder.

cd /usr/local/directadmin/custombuild

mceclip1.png

We will now check the version we have running with the following command

./build version

Afterward, we will update it with the following command

./build update

 

Updating PHP

To see what version of PHP is installed now use the following command:

php -v

mceclip2.png

When you are ready to install a new version use the following command:

./build set php1_release <release version>

You can set up to 4 different PHP versions at once; for example, I have used version 8.1

./build set php1_mode php-fpm

You have to define the mode on every PHP release, we advise using php-fpm since this is the latest.

mceclip3.png

After you have set up those sections, it's time to start the upgrade. Run the following command, and don’t panic. There will be a lot of codes flying over your screen. This is normal.

./build php n

 

Running into problems

When you have followed the current guide, and you run into an error with the message:

“configure: error: Package requirements (libzip >= 0.11 libzip != 1.3.1 libzip != 1.7.0) were not met:”

It’s possible you are running DirectAdmin on CentOS 7. There is an easy fix for this bug; Because libzip got removed in the repos for CentOS 7, there is a workaround run the following command and trigger the build again.

yum -y remove libzip
./build php n

 

If you run into other errors causing items failing to compile, this might be caused by other outdated packages.

To solve this, run the following:

dnf update
dnf upgrade
cd /usr/local/directadmin/custombuild
./build update
./build versions
./build update_versions
./build list_removals
./build remove_items

After running 'remove_items' there might be notifications of items not having been removed and that manual action needs to be taken. Please do so as well.
When this is done, run the following:

./build clean
./build all

 

If you run into more problems, that aren’t listed here don’t hesitate on sending us an email.

 

 

Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.

Articles in this section

See more