How can I setup Webmin to use multiple PHP versions?

Linode Staff

I'm trying to make some tests on this new server (CENTOS 8) before I complete the full migration from a CPANEL CENTOS 7.8.

I already installed Webmin/Virtualmin, and the migration tool from Virtualmin to import full CPANEL backup accounts worked great.
However, I'm having issues with the PHP versions.
My old server (the giver server running Centos 7.8) has PHP 5.6, which most of my customers portals (specially some versions of Wordpress they have) works fine.
When I imported into this new Centos 8 server, they don't display correctly, and some errors arise.
I tried to install MULTI Version PHP on this new server. The repos installed first the DEFAULT version for CENTOS 8 = PHP 7.2 (most stable and updated according to the repo). I went ahead and installed manually PHP 5.6 too. Then, even when I set those imported cpanel accounts (virtual servers) to use the PHP 5.6, I can't get them work.

Could you give me a hand here in order to have this new Server finally set up with the PHP 7 & 5.6 version, so I can continue with the migration and import of all the the Cpanel accounts from the old one?


3 Replies

Hey there,

So it looks like you you've completed most of the setup related to using multiple PHP version with Webmin, but based on your question I think there may have been one step you missed.

After you've installed php7.2 and php5.6, you'll need to enable the suexec_module Apache module. This will allow Webmin to use multiple versions of PHP. You can enable this by running nano /etc/httpd/conf/httpd.conf to open the httpd.conf in the Nano text editor. You can replace nano with your preferred text editor.

Once you have httpd.conf open, You'll want to find the line related to loading suexec_module, and uncomment it. Once done it should look like this:

LoadModule suexec_module modules/

Once that has been uncommented, you'll want to save and close the file, and then restart Apache:

service httpd restart

Once that is done, you should be all set. You can check this by opening up your Webmin System settings and rechecking your configuration from there.

I hope this helps!

Thanks for the reply

on httpd.conf, I had this line enabled:

Include conf.modules.d/*.conf

then under this file:

This line was enabled (uncommented) too:

LoadModule suexec_module modules/

Additionally, after running the "check-configuration" Virtualmin, I get this:

SuExec cannot be used to run PHP scripts in CGI or FCGId modes : The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin virtual server home directory is /home. CGI scripts run as domain owners will not be executed.

The following PHP versions are available : 5.6.40 (/bin/php56-cgi), 7.2.30 (/bin/php72-cgi)

The following PHP execution modes are available : fpm

The following PHP-FPM versions are available on this system : 5.6.40 (php56-php-fpm) 7.2.30 (php72-php-fpm)

Both (WEBMIN / VIRTUALMIN) were downloaded directly from developer, not third parties. According their FAQs site:

the end part states "you can use our automated install script, which insures a correctly configured suexec binary is installed."

Not sure what I installed wrong, or something incorrectly configured.

The setup for a CENTOS 8 with Dual PHP (7.2 and 5.6 // FPM and CGI) is WAY complicated. I tried a lot of things, and still didn't work.

I ended up creating another server, this time with CENTOS 7.8
and I have now Both PHP without any issue, and I'm able to switch versions inside a Virtual Server.

IMO Centos 8 requires a LOT of custom configurations and tweaks in order to have a real and effective multi-PHP platform, which are out of my knowledge.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct