How Best to Manage PHP.INI with Multiple Versions of PHP Under PHPBrew?

How Best to Manage PHP.INI with Multiple Versions of PHP Under PHPBrew?

I have managed to set up multiple versions of PHP (5.x and 7.0) on a test server (Ub. 12.04) under V.min with latest W.min V5.0 update. I have symlinked the PHPBrew PHP installation folders to appropriate subfolders in /opt/rh/. V.min then recognises the various versions of PHP and permits switching virtual servers between those versions of PHP, as proven by the ouput from phpinfo().

However there appears to be no obvious method for managing separate php.ini files for each virtual server as the "non-native" versions of PHP load the version of php.ini found within their own phpbrew folder, irrespective of what V.min reports as being the active php.ini file for the server in Services > PHP 5 Configuration.

What is the best practice when it comes to managing PHP config files in this situation?

Sorry for this.
But the error was from installing the Let's Encrypt on most of my domain's
I made 3 errors and this resolting in 3 lines with SSLCACertificateFile. That was not having any other parameters on it.
I just deleted the lines and now the config tjek was okay :-)

The answer is simple - once you know it. V.min sets up an environment variable (PHPRC) for each version of PHP that it has found (f/cgi only). PHPRC defines the first place to be checked by PHP for a php.ini file before looking in the default folder (defined when PHP was compiled).

So the trick is to add add suitably-named folder(s) for each additional PHP version in the virtual server's /etc folder. There will be a /php5 folder there already for the PHP originally installed,.

So add folder(s) for each additional PHP version like (e.g. for newly added PHP5.5.x) /home/your_domain_id/etc/php5.5 alongside the existing folder - /php5. Pop your domain-specific php.ini files for the new PHP in there and it will be loaded in preference to the default php.ini. Or you can add a symlink with a name like 'php5.5' pointing to a folder containing the generic php.ini file you wish to use for that PHP.