Original issue: #1489898: Allow PHP version per platform/site
This is just an idea, but i wanted to test a site using another PHP version so i did the following
inside /var/aegir/config/includes/fastcgi_params.conf i added:
## Custom PHP FPM port
set $custom_php_fpm_port 0;
inside /var/aegir/config/includes/fastcgi_params.conf (nginx_octopus_include.conf) I added
set $php_fpm_port 9090;
if ($custom_php_fpm_port) {
set $php_fpm_port $custom_php_fpm_port;
}
and I changed all occurrences of 9090 with $php_fpm_port.
inside my vhost file I added to swith to PHP 5.2.17:
set $custom_php_fpm_port 9000;
This works, but if the site gets verified the vhost will get rewritten, so to have this inside aegir we need:
- A platform option to specify the PHP version (or port), if not set it will use the default
- A site option to specify the PHP version (or port), if not set it will use the platform one
- A way to tell drush which PHP version to use
The idea is to easily clone a site running on PHP 5.2 and switch the PHP version of the clone.
I'm willing to create patches for provision (6 or 7?) and for drush, but i want to make sure if this will be accepted once drush is able to support it?
Comments
Comment #1
steven jones commentedSorry for the non-response.
Here's how this one should proceed, if you are still around and interested:
I don't think we can support this in the core Aegir package, as it's quite complicated it seems!
Comment #2
omega8cc commentedSo we should mark this as won't fix, I guess.
The problem I see is that even if we could do this magic with port switching for web access - as it is a matter of setting correct port to use per platform (or even per site), we can't do the same for php-cli used by the Provision backend, because it is on Drush, not Provision level to decide which php-cli to use, it needs to be hardcoded at the top of the Drush wrapper (the path to the binary), so there is no way we could switch this on the fly or even via any provision level task, because it is a classic egg/chicken syndrome - you need to fire up php-cli to do anything and then it is too late, because you are already running it - and php-cli is of course a cli, not a port based tool.
That is why we do that required hardcoding in Octopus on system install or upgrade, since you can't really do this from the Aegir level later.