How to change default version of mod_php?

3 posts / 0 new
Last post
#1 Mon, 06/26/2017 - 14:12
ezmenus

How to change default version of mod_php?

Hello! I am running CentOS 7.3.1611 with apache 2.4.6 and have PHP 5.6 & 7.0 installed along with virtualmin 5.99/ webmin 1.844. I host a few applications that require mod_php version 5.6. Is there a method for selecting the default version of mod_php to be 5.6? Apache is running in prefork mode. Thanks in advance!!!

Fri, 07/07/2017 - 17:41
Joe
Joe's picture

Don't use mod_php. Use php-fpm or mod_fcgid, Virtualmin can configure either and can select between versions on a per-domain basis.

If you really need to use mod_php (are you really, really, sure?) you'd need to configure the other version manually. Virtualmin doesn't really touch versions with regard to mod_php, because there's no way to run multiple versions...so it leaves it alone. You'll likely just need to edit or create a new /etc/httpd/conf.d/php.conf (or php56.conf, or whatever) and have it load the php56 libraries. Don't add SetHandlers (and disable any that may currently be there), as that'll break your php7 domains...you can't have a centrally configured SetHandler for PHP and still use multiple versions. But, just use php-fpm and don't make things complicated.

--

Check out the forum guidelines!

Sat, 07/15/2017 - 23:06 (Reply to #2)
ezmenus

Thanks for the help Joe! Much appreciated. For now, I do indeed need to run php_mod to support an application some of my customers run. So I ended up stripping every version of php on the server and installing just php5.6. Everything is working great now.

Topic locked