How to quickly switch PHP to newer version?

QHow to quickly switch PHP-FPM and PHP-CLI version for all Drupal 9, 8, 7 and Pressflow 6 sites on your Aegir Octopus instance? It is enough to use control files, as explained in the how-to below:

### ### Support for PHP-FPM version switch per Octopus instance (also per site) ### ### ~/static/control/fpm.info ### ### This file, if exists and contains supported and installed PHP-FPM version, ### will be used by running every 2-3 minutes system agent to switch PHP-FPM ### version used for serving web requests by this Octopus instance. ### ### IMPORTANT: If used, it will switch PHP-FPM for all Drupal sites ### hosted on the instance, unless multi-fpm.info control file also exists. ### ### Supported values for single PHP-FPM mode which can be written in this file: ### ### 8.1 ### 8.0 ### 7.4 ### 7.3 ### 7.2 ### 7.1 ### 7.0 ### 5.6 ### ### NOTE: There must be only one line and one value (like: 7.4) in this file. ### Otherwise it will be ignored. ### ### NOTE: if the file doesn’t exist, the system will create it and set to the ### lowest available PHP version installed, not to the system default version. ### This is to guarantee backward compatibility for instances installed ### before upgrade to BOA-4.1.3, when the default PHP version was 5.6, ### as otherwise after the upgrade the system would automatically switch such ### accounts to the new default PHP version which is 7.4, and this could break ### most of the sites hosted, never before tested for PHP 7.4 compatibility. ### ### ### It is now possible to make all installed PHP-FPM versions available ### simultaneously for sites on the Octopus instance with additional ### control file: ### ### ~/static/control/multi-fpm.info ### ### This file, if exists, will switch all sites listed in it to their ### respective PHP-FPM versions as shown in the example below, while all ### other sites not listed in multi-fpm.info will continue to use PHP-FPM ### version defined in fpm.info instead, which can be modified independently. ### ### foo.com 8.0 ### bar.com 7.4 ### old.com 5.6 ### ### NOTE: Each line in the multi-fpm.info file must start with main site name, ### followed by single space, and then the PHP-FPM version to use. ### ### ### Support for PHP-CLI version switch per Octopus instance (all sites) ### ### ~/static/control/cli.info ### ### This file, while similar to fpm.info, if exists and contains supported ### and installed PHP version, will be used by running every 2-3 minutes ### system agent to switch PHP-CLI version for this Octopus instance, but ### it will do this for all hosted sites. There is no option to switch this ### or override per site hosted. ### ### Supported values which can be written in this file: ### ### 8.1 ### 8.0 ### 7.4 ### 7.3 ### 7.2 ### 7.1 ### 7.0 ### 5.6 ### ### There must be only one line and one value (like: 7.4) in this control file. ### Otherwise it will be ignored. ### ### NOTE: if the file doesn’t exist, the system will create it and set to the ### lowest available PHP version installed, not to the system default version. ### This is to guarantee backward compatibility for instances installed ### before upgrade to BOA-4.1.3, when the default PHP version was 5.6, ### as otherwise after the upgrade the system would automatically switch such ### accounts to the new default PHP version which is 7.4, and this could break ### most of the sites hosted, never before tested for PHP 7.4 compatibility. ### ### IMPORTANT: this file will affect only Drush on command line and Drush ### in Aegir backend, used for all tasks on hosted sites, but it will not ### affect PHP-CLI version used by Composer on command line, because Composer ### is installed globally and not per Octopus account, so it will use system ### default PHP version, which is, since BOA-4.1.4-rel, PHP 7.4 and can be ### changed only by changing system default _PHP_CLI_VERSION in the file ### /root/.barracuda.cnf and running barracuda upgrade. ###

!Please note that PHP versions older than 7.4 are officially deprecated and will not receive any upgrades nor security fixes, so you should seriously consider switching at least to PHP 7.4 — It’s twice as fast as 5.6 !

Create Account or request a free Test Drive
Already 900+ hosts powering thousands of Drupal sites are running on our high-performance Aegir BOA stack
© 2009-2023 Omega8.cc | ul. Zlota 59, 14th floor Skylight Building, 00-120 Warsaw, Poland | Twitter
Smokin’ Fast Drupal Hosting in Amsterdam · Chicago · Frankfurt · London
Madrid · New York · San Jose · Singapore · Sydney · Toronto · Warsaw