Update php version without downtime

ericovk

Verified User
Joined
Apr 17, 2012
Messages
229
Location
Rotterdam, Netherlands
Last weekend I updated some of our servers to custombuild 2.0. Because these servers are production server, I don't really like the downtime of 1+ hour.
When updating php to another version, I have ± 15 minutes downtime. That made me wonder if it's possible to update php without downtime on DA?

I also read it is possible to install multiple php versions. Is it possible to, for instance run php 5.6 and install php 7.0 in the background. After installing just switch (forward and/or back) to the other version?

I know a Dutch hosting platform is offerting this php switching without downtime, but this platform isn't based on DA. If this isn't possible, it would be a great feature to have.
 

Attachments

  • Screen Shot 2016-04-04 at 11.51.51.png
    Screen Shot 2016-04-04 at 11.51.51.png
    18.8 KB · Views: 146
It's possible to have 2 php versions installed, see options.conf. However it has some limitations from the combinations you can use.

I've seen a kindlike example like in your screenshot, also with a Dutch hosting provider who was provider 4 or 5 php versions.
This can only be done by using Cloudlinux.
 
Hello,

The main reason you have a downtime (as well as others) is difference of versions:

apache 2.2 => apache 2.4

You can not use PHP modules build for Apache 2.2 with Apache 2.4. They should be rebuild with any PHP mode. PHP-FPM might be an exception, but there is no support for PHP-FPM in CustomBuild 1.x.

And now there's a question how much time do you need to build PHP? To make PHP 7 and PHP 5.6 it might take upto 20-30 minutes and even more, depending on how much CPU and RAM you have. So if it's possible add extra CPU/RAM in order to increase speed of build process.

You can speed up the things even more if you use

Code:
 ./build php_expert php_release php_mode

to pre-install PHP, then build apache and rewrite configs.

Test it on a dev server see and and document steps you need to perform.
 
I now have Apache 2.4 installed. Can I also use
Code:
./build php_expert php_release php_mode
to only upgrade php from (for example) 5.5 to 5.6?
 
If you have already Apache 2.44 installed, then install PHP as usual

Code:
./build php d

Disable the second PHP mode (if you have it, with mod_php you can still have suphp as the second option) and install main PHP version. Then install both PHP versions.

p.s. I do guarantee result of work done by myself and can not guarantee that you won't run into a downtime.
 
Last edited:
Back
Top