Some weeks ago we upgraded to Ubuntu 16.04 LTS, which comes with PHP 7 by default and does not provide PHP 5.6. Our customers’ websites aren’t yet ready for PHP 7, so we installed PHP 5.6 from another (non-Ubuntu) repository. Since that upgrade, PHP 5.6 has not recognized the site-specific PHP settings that Virtualmin will create. A look at phpinfo() shows “Additional .ini files parsed”, and none of those paths include the user homes where Virtualmin places php.ini.
Is the ability to parse site-specific php.ini files a function of PHP or Virtualmin? If it’s up to Virtualmin, how can I troubleshoot it? If it’s PHP, how do I (re?)configure it to parse site-specific php.ini files? Would that require giving up PHP from this particualr repository and compiling my own?
That functionality should work in any supported distro… but you could be seeing a PHP config issue related to those non-standard PHP versions.
When looking at the phpinfo() output, what does it say next to the “Server API” section? Does it say something about “Apache handler”, rather than saying “CGI/FastCGI”?
It should say “CGI/FastCGI”, but if it doesn’t, that may mean that it’s using mod_php, which could cause what you’re seeing.
Ah! Yes, it does say “Apache 2.0 Handler” next to “Server API”. So it seems like I should install the php5.6-fpm package and disable mod_php in Apache. Then in Virtualmin, I go to Server Configuration -> Website Options for each domain and make sure “PHP script execution mode” is set for “FCGId (run as virtual server owner)”. Is that correct?