Upgrading to PHP-FPM 7.0 (or preferably 7.2)

NOTE: please skip to comment #3 - i've started over again with a complete fresh install. Thanks.

Hi, I've been trying to upgrade the version of PHP-FPM to v7.0 or preferably v7.2.

I started by uninstalling PHP 5.4.16 (default version bundled in Virtualmin), then yum install rh-php70-php-fpm, but all I got in the virtual server was server error 503. Tried to debug but didn't really get very far.

So I searched the internet and the forums for answers and came across a post which suggested running the following command..

virtualmin modify-web --mode fcgid --all-domains

Which I don't think I should have run!

Now when I do virtualmin check-config I get PHP-FPM support was not detected : No FPM configuration directory found.

A systemctl status rh-php70-php-fpm shows that it is active and running, so I'm guessing I deleted some config somewhere.

First, I guess I need to fix the missing config issue, as currently I can't select PHP-FPM as the execution mode on the VS.

Then, I guess I need to try and work out why the 503 error was being thrown.

Can anyone help me try and restore the correct config for php-fpm, and possibly even help me install php-fpm v7.2 please rather than 7.0?

Thanks in advance.

Status: 
Active

Comments

Ok, I did systemctl stop rh-php70-php-fpm and yum install php-fpm and the php-fpm config has been restored, and so I am getting PHP-FPM version 5.4.16 support is available on this system. again.

So now, how do I get php-fpm v7.0 working instead of v5.4 (or preferably php-fpm v7.2).

It might help if I explain what I ultimately need to do....

I have some old websites which will only run on PHP v5.4/5.6 and so need that as an option (no php-fpm needed), all others I would like to run under PHP-FPM v7.2.

Many thanks.

Oh dear, now apache won't start with error Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration

I remember that i was getting this issue before, when trying to use php-fpm 7.0, and as a test I commented out the lines in httpd.conf mentioning php_admin_value. Now that I have reversed the config back to php-fpm 5.4 I was expecting it to work again... I can see in /etc/php-fpm.d/www.conf there are various php_admin_values set, so why are they not being picked up?

I'm so lost...

I've started from scratch and done a complete fresh install. If you could just please help me set up php-fpm 7.0/7.2 (instead of 5.4), but keep 5.4/5.6 (without php-fpm) for the older sites, that would be much appreciated.

Thanks!

Right now, Virtualmin doesn't support multiple PHP-FPM versions (that will be in the next release).

Hi, thanks for your reply, but I'm not after multiple PHP-FPM versions. I just want to upgrade the version of PHP-FPM used on the system (preferably to PHP 7.2), but keep PHP FCGI 5.4/5.6 for older sites (no PHP-FPM required).

That's unfortunately not a setup we've tested, so we don't have exact steps for you.

The simplest way to accomplish that would be to use FCGID or CGI for sites that need PHP 7.x, as that's installed and setup by default on a new CentOS system like you're using there. That should work well, and can be configured in Server Configuration -> Website Options. You can then use Server Configuration -> PHP Versions to set the correct PHP version for your site.

If you want to use PHP 7.x in PHP-FPM, you can do that, but we can't guarantee that you won't bump into problems along the way. We'd highly recommend trying this out on a test server first, and making a backup of the configs in your /etc directory just in case.

What you'd need to do though is disable the existing FPM config in Apache, and then install a newer PHP-FPM version from the SCL repo (the same repo where you're other PHP 7.x versions came from).

Hi, ok thanks. That's a real shame. I moved to Virtualmin from WHM on the understanding it supported PHP-FPM and multi-php switching (which I understand, it kind of does, but not exactly as I need it).

PHP-FPM is much faster than FCGID/CGI from my experience, and i'm not sure I can justify moving a site currently benefiting from PHP-FPM 7.0 on cPanel to standard FCGID 7.x on Virtualmin.

The only problem is when you want using PHP-FPM 5.6 and PHP-FPM7.0 in the same time with your virtual hosts. With one PHP-FPM let's say 7.0 Virtualmin is working and doing the tasks in background as expected.

A few things are not working properly and I already posted an issue in Bug tracker. When you upgrade or install a new PHP version you will end configure some things manually. Virtualmin is not allowing you editing the pool file in its interface and this is a "must have". In case you want some different values for your virtual host like max_upload_size you have to use Terminal to edit the pool file. I reported this issue in Forum.

You can do it, and others have been able to get that working, we're just not able to walk you through it.

Another option would be to use a different distribution. With, say, Ubuntu 18.04, it uses PHP 7.x out of the box, including PHP-FPM.

@ADDISON74 - thanks, but I'm not after multiple PHP-FPM versions. I just want to upgrade the version of PHP-FPM used on the system (preferably to PHP 7.2).