PHP 7.4 settings / PHP 8 conflict

Hi there,

I habe a new server with PHP8 and added PHP7.4 later. I changed some settings like MEMORY_LIMIT, POST_MAX_SIZE, … and saved them. After that, PHP 7.4 won’t come up. The debug output is

STOPPEDas of10.1.2022, 15:47:54
php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Mon 2022-01-10 14:44:26 UTC; 3min 27s ago
       Docs: man:php-fpm7.4(8)
    Process: 1668 ExecStart=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config /etc/php/7.4/fpm/php-fpm.conf (code=exited, status=78)
    Process: 1674 ExecStopPost=/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
   Main PID: 1668 (code=exited, status=78)

Jan 10 14:44:26 myproject-golive systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Jan 10 14:44:26 myproject-golive php-fpm7.4[1668]: [10-Jan-2022 14:44:26] ERROR: Another FPM instance seems to already listen on /run/php/php8.0-fpm-myproject-alt.sock
Jan 10 14:44:26 myproject-golive php-fpm7.4[1668]: [10-Jan-2022 14:44:26] ERROR: FPM initialization failed
Jan 10 14:44:26 myproject-golive systemd[1]: php7.4-fpm.service: Main process exited, code=exited, status=78/CONFIG
Jan 10 14:44:26 myproject-golive systemd[1]: php7.4-fpm.service: Failed with result 'exit-code'.
Jan 10 14:44:26 myproject-golive systemd[1]: Failed to start The PHP 7.4 FastCGI Process Manager.
Jan 10 14:44:33 myproject-golive systemd[1]: php7.4-fpm.service: Unit cannot be reloaded because it is inactive.
Jan 10 14:45:17 myproject-golive systemd[1]: php7.4-fpm.service: Unit cannot be reloaded because it is inactive.
Jan 10 14:45:53 myproject-golive systemd[1]: php7.4-fpm.service: Unit cannot be reloaded because it is inactive.
Jan 10 14:47:53 myproject-golive systemd[1]: php7.4-fpm.service: Unit cannot be reloaded because it is inactive.

Is there a conflict between PHP 7.4 and 8 because of this line?
ERROR: Another FPM instance seems to already listen on /run/php/php8.0-fpm-myproject-alt.sock

Hello @sewid,

Did you try restarting PHP 7.4 from the services page?

Do let us know if that does not work with the server name you’re currently having issues with.

Hi anish,

yes, I tried restarting PHP 7.4, I even restarted the complete server. Without success. I will write you the server name as personal message.

Hello @sewid,

We will look into the issue and get back to you.

Hello @sewid,

How did you update those configs from the Cleavr UI or by SSHing into the server?

Checking the heartbeat of PHP 7.4 shows no errors. Can you check it again?

Hi anish, I updated all settings using the UI. The only manual change was to run

pecl install redis

and adding

extension=redis.so

to /etc/php/8.0/fpm/php.ini and /etc/php/8.0/cli/php.ini.

As a workaround, I removed PHP8 from the server yesterday. After that, PHP 7.4 was working again. I just reinstalled PHP8 and rebootet the server, now PHP 7.4 has stopped working as before.

Thanks for the information.

We’re looking into the issue.

Hello @sewid,

I think I found out the issue but do you have any ways to reproduce this? Or do you remember anything you did on the server by SSHing into it?

NGINX config of your WP site that uses PHP 7.4 is using configs of PHP 8.0.

If all you did is update configs via Cleavr only then we really need to dig into it to find the root cause of the issue so any repro steps would be useful.

Hi anish,

what I did: I installed a Laravel optimized server and added a Laravel application (no problem). By default, the Laravel optimized server installed PHP 8.0. I played around with the Laravel nginx-config, because I wanted to add some redirections. I also redis (see above).

After that, I installed added a WordPress site - using PHP 8.0. Because I have some problems with this site and I want to check, if they correspond with PHP 8.0, I added PHP 7.4 as additional service to the server and switched the site configuration to PHP 7.4. The site was working, but my problems persist, that’s why I changed MEMORY_LIMIT and some other paramerers (only using the Cleaver UI). Because PHP 7.4 won’t come up, I restarted the server - same result, the problems as described above.

All changes to the WordPress site have been made using the UI. I did not tweak any configuration (for the WP site) by SSH.

Thank you for the response.

We will investigate on this to find out what actually happened and get back to you.

There is also an install option for Redis in Cleavr. Is there a special reason that you didn’t used that one?
I think it’s always a good plan to use the CP functions first :slight_smile:

1 Like

Hello @sewid,

Sorry for being late with the support. But your issue seems to be fixed now. It has something to do with the FPM config.

We’re trying to repro the steps you provided and trying to see how you got here in the first place so that we can get it resolved.

The Laravel optimized Server already contains the Redis service, but when I try to use Redis, Laravel provided me an error message. As described here you need a PHP Redis extension. That’s why I had to run

pecl install redis

Great, thank you - I will give it a try.

2 Likes

I’m using always the App server type and install later the required “modules” like php and redis. Never installed the php redis extension manually. Actually it makes no sense to install php and redis for the laravel server type and not the php extension. Maybe this is something that @amiedema will check?

3 Likes

We do install the php extension but there appears to potentially be an issue with the order of operations that we’ll look into further.

We’ve just released a fix for php-redis.

It now should be added with new PHP installs. If you have PHP currently running, you can either uninstall / reinstall PHP or SSH into the server and run the following command:

apt install php<PHP_VERSION>-redis && echo "extension=redis.so" > /etc/php/<PHP_VERSION>/mods-available/redis.ini && ln -sf /etc/php/<PHP_VERSION>/mods-available/redis.ini /etc/php/<PHP_VERSION>/fpm/conf.d/20-redis.ini && ln -sf /etc/php/<PHP_VERSION>/mods-available/redis.ini /etc/php/<PHP_VERSION>/cli/conf.d/20-redis.ini

Change out <PHP_VERSION> with 7.2, 7.3, 7.4, 8.0, 8.1…

To check, you can run php<PHP_VERSION> -m and look for redis in the list.

3 Likes

I think I messed up with my php 8.0 conf file, how to get the fresh copy?

Hmmm… I think probably the easiest would be to remove PHP 8.0 from the server from the server > services section, and then reinstall it.

Thanks, php 8.0 has bene removed after click Confirm.

For a better optimization environment for WooCommerce site, do you recommend php 8 or php 8.1 ?

Go with PHP 8.0 for WordPress, even it has introduced many supportive changes with 5.9 for PHP 8.1 some parts are still not optimized for 8.1. Same goes for WooCommerce. I guess 8.1 will be fully supported with the release of WP 6. Also take care of third-party plugins (not from automatic) as those follow other or even no rules at all.

2 Likes