The web is about to get a whole lot faster! Just this week, HTTP version 2 was released, promising faster page load times.
Now it’s PHP which is getting a huge upgrade, which comes with a bunch of new features and improvements.
If your server runs DirectAdmin and you are looking to upgrade your PHP version from PHP 5.6 to PHP 7.0 or PHP 5.5 to PHP 7.0, than this is the right guide for you. This guide should work on any kind of Linux flavour, including CentOS and Ubuntu.
First, open an SSH session to your webserver and let’s first check for any server updates.
Ubuntu
sudo apt-get update
CentOS
sudo yum update
Since you run the DirectAdmin control panel on your webserver, some packages are handled through CustomBuild. The next step is to update your PHP to version 7.0. So, we go to the right directory
cd /usr/local/directadmin/custombuild
Now you are in the right directory, let’s bump up that PHP version number:
./build set php1_release 7.0 ./build update ./build php d
Your server should now be running version 7 of PHP! To verify the version number, paste the following code in your terminal:
php -v
The output should look similar to this one:
PHP 7.0.0 (cli) (built: Dec 4 2015 04:55:02) ( NTS ) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
Thomas, thanks so much. You are the man.
Starting httpd: /etc/init.d/httpd: line 55: 13569 Segmentation fault (core dumped) $ENV $httpd -k start -DSSL
Getting this after updating, any clue?
Hi Dennis,
I have the same problem. HTTPD could not be restarted. Would be nice if someone know what it is and more important how to solve.
Hello Jan,
Have you tried to start it with force?
Nice!
Excellent guide on updating custombuild.
A small note for people who get no other option than PHP 5.4.45, you probably have an older version of custombuild installed.
Use this command to check the version: ./build version
You need 2.0.0 for later PHP versions than 5.4
Upgrading Custombuild can be done this way:
cd /usr/local/directadmin
mv custombuild custombuild_1.x
wget -O custombuild.tar.gz
http://files.directadmin.com/services/custombuild/2.0/custombuild.tar.gz
tar xvzf custombuild.tar.gz
cd custombuild
Hi Sjoerd
useful addition, thank you for your comment!
Best regards
Thomas
special thanks thomas