Broken PHP with Virtualmin.

Following the “Multiple PHP version” guide: https://www.virtualmin.com/documentation/web/multiplephp

In System Settings > Re-Check Configuration:

The following PHP versions are available : 5.6.30 (/usr/bin/php5-cgi), 7.0.22 (/usr/bin/php-cgi7.0), 5.6 (mod_php)

I can also see both 5.6.30 and 7.0.22 in “PHP Versions” in a virtual server. However, this is where the problem starts.

When running phpinfo() on any virtual server, it returns PHP7-fpm, while all servers are set to PHP5, with FCGId as execution mode. phpinfo() also returns all configs it’s currently using, and I’ve double-checked: updating PHP7-fpm configuration files and restarting PHP7-fpm definitely updates the phpinfo().

All virtual servers use the global PHP7-fpm config files instead of using FCGId and the config files in their home folder.

Trying to upgrade the install scripts also returns:

Failed to upgrade scripts : Could not find PHP version for /home/x/public_html/webmail

My Wordpress websites can no longer install anything on Wordpress or do any updates because it’s not running as the virtual server’s users.

There is no way to return to PHP5 or PHP7 with FCGId, nothing in Virtualmin works or changes anything.

Any advice?

I fixed it by installing php5-mysql

apt-get install php5-mysql

then restarted the /etc/init.d/php-fcgi-domain-com

service /etc/init.d/php-fcgi-domain-com restart

Can someone comment on how to select the PHP version to use with Nginx?

sorry, I replied to the wrong thread.