Reputation: 937
I have a server running LEMP stack that hosts a wide range websites. During the night, all the sites got shutdown and the message "502 bad gateway" Is displayed. I followed the stream of errors and concluded that php7.4-fpm was the issue. I need help to figure out how to solve the error below.
NOTE: During the night, no updates or changes has been made to the system
● 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 Tue 2021-07-27 09:35:38 CEST; 7s ago
Docs: man:php-fpm7.4(8)
Process: 1561620 ExecStart=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config /etc/php/7.4/fpm/php-fpm.conf (code=exited, status=78)
Process: 1561621 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: 1561620 (code=exited, status=78)
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal php-fpm7.4[1561620]: [27-Jul-2021 09:35:38] ERROR: [/etc/php/7.4/fpm/php-fpm.conf:98] value is NULL for a ZEND_INI_PARSER_ENTRY
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal php-fpm7.4[1561620]: [27-Jul-2021 09:35:38] ERROR: failed to load configuration file '/etc/php/7.4/fpm/php-fpm.conf'
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal php-fpm7.4[1561620]: [27-Jul-2021 09:35:38] ERROR: FPM initialization failed
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal systemd[1]: php7.4-fpm.service: Main process exited, code=exited, status=78/CONFIG
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal systemd[1]: php7.4-fpm.service: Failed with result 'exit-code'.
Jul 27 09:35:38 Ubuntu-2010-groovy-64-minimal systemd[1]: Failed to start The PHP 7.4 FastCGI Process Manager.
I'm grateful for any ideas that you could have!
Upvotes: 3
Views: 5594
Reputation: 7461
Just an idea, as I had the same error today setting up a fresh Alma linux server with httpd
and php74-php-fpm
from the remi repository.
I suggest the root cause of your problem was that the config had been altered some time before your shutdown, and that bad config then lurked causing no immediate problem. At the time of the problem your servers were restarted for some reason, maybe an overnight job run by someone else, a regular update of system packages leading to daemons being restarted, or a power failure. When they tried to start up again, they used the current config, which was by that time corrupt.
In my case I was editing the FPM config file /etc/opt/remi/php74/php-fpm.d/www.conf
and accidentally used a #
character for a comment, e.g. # My changes
. On restarting the server, I got the same value is NULL for a ZEND_INI_PARSER_ENTRY
error message in the journal. The line numbers mentioned did not help, they basically referred to how php-fpm.conf
includes every file in php-fpm.d
which happens to include www.conf
but didn't specify which line had the error.
The fix in my case was to use the correct ;
(semicolon) character, and not a #
, for comments in www.conf
.
This may not have been your case but I hope it helps someone :)
Upvotes: 12
Reputation: 937
Update: I solved this issue by removing php7.4-fpm and installing it again. However, the problem still remains. Why did php7.4-fpm suddenly stopped working?
Upvotes: 1