[php-fpm] - Issue on a dedimax with ubuntu Focal Fossa (20.04 LTS) -
Lightning-fast WordPress on Nginx
Brought to you by:
jessuppi
Originally created by: gabrielstuff
First, thanks for this set of scripts which are really useful.
The php-fpm service won't run until I changed the user in the service configuration.
After a fresh install, I ended up with the following : /lib/systemd/system/php7.4-fpm.service
[Unit]
Description=The PHP 7.4 FastCGI Process Manager
Documentation=man:php-fpm7.4(8)
After=network.target
[Service]
Type=notify
ExecStart=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config /etc/php/7.4/fpm/php-fpm.conf
ExecStartPost=-/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74
ExecStopPost=-/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target
I've added :
User=www-data
Group=www-data
in the [Service] section. Final file looks like:
[Unit]
Description=The PHP 7.4 FastCGI Process Manager
Documentation=man:php-fpm7.4(8)
After=network.target
[Service]
Type=notify
User=www-data
Group=www-data
ExecStart=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config /etc/php/7.4/fpm/php-fpm.conf
ExecStartPost=-/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74
ExecStopPost=-/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target
I do not know if it is intended or not.
Originally posted by: jessuppi
Thanks for sharing @gabrielstuff
When you say "fresh" install do you mean you spun up a brand new Ubuntu 20.04 VM in this case? Or do you possibly have other versions of PHP installed already on this machine?
What is the output of
service php7.4-fpm statusafter the failed start?Did you follow the standard SlickStack
ss-installwizard or did you compile any of the packages manually, etc?Also, did SlickStack properly install/modify your
php.iniandphp-fpm.confandwww.conffiles?Ref: https://mirrors.slickstack.io/php-fpm/
Ref: https://github.com/oerdnj/deb.sury.org/issues/1338
Ref: https://github.com/oerdnj/deb.sury.org/issues/1334
Ref: https://www.howtoforge.com/tutorial/how-to-compile-and-install-php-7.4-on-ubuntu-18-04/
Originally posted by: gabrielstuff
hello and thanks for the quick reply.
"Fresh" like in brand new instance, just installed without anything on it.
The output was something weird that I could not find by googling except in the source code of php-fpm source code:
php-fpm "unable to set priority for the master process"This appears to be link with root being used by the service because it only tries to
setPrioritywhen root user is detected.As said, after changing the
php7.4-fpm.servicewith the user part, all was fine.Let me check the file, do you want me to attach them ? how can I make sure they have been correctly created / modified by SlickStack ?
I followed the wizard by running :
cd /tmp/ && wget -O ss slick.fyi && bash ssI did not run anything else.Originally posted by: jessuppi
I assume perhaps something in PHP-FPM config files did not setup correctly during
ss-installand thus the service didn't have the complete users/options to initialize properly.You can check
service php7.4-fpm statusoutput for more info if the service fails....these are boilerplates that are downloaded from our mirrors and then modified during
ss-installso if you see the PHP-FPM services fails to start you cansudo nanothese files and ensure the @PLACEHOLDERS are no longer there... in other words, that these files look like proper configuration files with proper settings/variables.Originally posted by: gabrielstuff
Hello,
From what I read:
It all looks clean. Will soon deploy an other slickstack, and will update.
Originally posted by: damiafaw
My php-fpm fails to start on reboot each time - recent server of the last week or two, built from scratch, SS_BUILD="DEC2020A"
Was this issue resolved - thjis is after a reboot and PHP failed to start - I had to create the directory /run/php/ before it would start....but issue happens after every reboot and have to redo again.
Is it related to rsync? checking status on rsync shows
service rsync status
● rsync.service - fast remote file copy program daemon
Loaded: loaded (/lib/systemd/system/rsync.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Condition: start condition failed at Mon 2020-12-14 23:59:42 AEDT; 10min ago
└─ ConditionPathExists=/etc/rsyncd.conf was not met
Docs: man:rsync(1)
man:rsyncd.conf(5)
Dec 14 23:59:42 XXXXXXXX systemd[1]: Condition check resulted in fast remote file copy program daemon being skipped.
XXXXXXXX@XXXXXXXX:~$ service php7.4-fpm status
● 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 2020-12-14 23:59:43 AEDT; 11s ago
Docs: man:php-fpm7.4(8)
Process: 599 ExecStart=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config /etc/php/7.4/fpm/php-fpm.conf (code=exited, status=78)
Process: 668 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/SUCCES>
Main PID: 599 (code=exited, status=78)
root@XXXXXXXX:~# journalctl -xe
Dec 15 00:01:00 XXXXXXXXX systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
-- Subject: A start job for unit php7.4-fpm.service has begun execution
-- Defined-By: systemd
-- A start job for unit php7.4-fpm.service has begun execution.
-- The job identifier is 571.
Dec 15 00:01:00 XXXXXXXXX php-fpm7.4[2305]: [15-Dec-2020 00:01:00] ERROR: Unable to create the PID file (/run/php/php7.4-fpm.pid).: No such file or directory
Dec 15 00:01:00 XXXXXXXXX php-fpm7.4[2305]: [15-Dec-2020 00:01:00] ERROR: FPM initialization failed
Dec 15 00:01:00 XXXXXXXXX systemd[1]: php7.4-fpm.service: Main process exited, code=exited, status=78/CONFIG
-- Subject: Unit process exited
-- Defined-By: systemd
-- An ExecStart= process belonging to unit php7.4-fpm.service has exited.
-- The process' exit code is 'exited' and its exit status is 78.
Dec 15 00:01:00 XXXXXXXXX systemd[1]: php7.4-fpm.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- The unit php7.4-fpm.service has entered the 'failed' state with result 'exit-code'.
Dec 15 00:01:00 XXXXXXXXX systemd[1]: Failed to start The PHP 7.4 FastCGI Process Manager.
-- Subject: A start job for unit php7.4-fpm.service has failed
-- Defined-By: systemd
-- A start job for unit php7.4-fpm.service has finished with a failure.
-- The job identifier is 571 and the job result is failed.
root@XXXXXXXXX:~# mkdir /run/php/
Originally posted by: linux-brezel
Hello.
If you are reboot your system it will fail again. Because the path /run/php isn't exist.
Know anybody why?
Originally posted by: jessuppi
Please mention what cloud network and type of server you are using? What errors do you see during installation?
It is very difficult to diagnose problems without more information...
Originally posted by: linux-brezel
Hi,
is it possible that this problem only occurs with V-Servers?
........
the system is a Debian 10. I got the same fail messages as the previous.
If I do mkdir /run/php so i can start by command: service php7.4-fpm restart - without any fail messanges.
an by systemctl status php7.2-fpm
● 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: active (running) since Mon 2021-01-04 14:55:44 CET; 3min 25s ago
Docs: man:php-fpm7.4(8)
Process: 10633 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/7.4/fpm/pool.d/www.conf 74 (code=exited, status=0/SUCCESS)
Main PID: 10630 (php-fpm7.4)
Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
Tasks: 3 (limit: 4915)
Memory: 16.3M
CGroup: /system.slice/php7.4-fpm.service
├─10630 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
├─10631 php-fpm: pool www
└─10632 php-fpm: pool www
Jan 04 14:55:44 whisky-test systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Jan 04 14:55:44 whisky-test systemd[1]: Started The PHP 7.4 FastCGI Process Manager.
but after reboot it will be
● 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 2021-01-04 15:00:27 CET; 3s ago
Docs: man:php-fpm7.4(8)
Process: 10741 ExecStart=/usr/sbin/php-fpm7.4 --nodaemonize --fpm-config /etc/php/7.4/fpm/php-fpm.conf (code=exited, status=78)
Process: 10742 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: 10741 (code=exited, status=78)
Jan 04 15:00:27 whisky-test systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Jan 04 15:00:27 whisky-test php-fpm7.4[10741]: [04-Jan-2021 15:00:27] ERROR: unable to bind listening socket for address '/run/php/php7.4-fpm.sock': No such file or directory (2)
Jan 04 15:00:27 whisky-test php-fpm7.4[10741]: [04-Jan-2021 15:00:27] ERROR: FPM initialization failed
Jan 04 15:00:27 whisky-test systemd[1]: php7.4-fpm.service: Main process exited, code=exited, status=78/CONFIG
Jan 04 15:00:27 whisky-test systemd[1]: php7.4-fpm.service: Failed with result 'exit-code'.
Jan 04 15:00:27 whisky-test systemd[1]: Failed to start The PHP 7.4 FastCGI Process Manager.
If you are use after reboot - mkdir /run/php && service php7.4-fpm start
then it is ok.
Originally posted by: jessuppi
For anyone on this thread, SlickStack has only been tested on Ubuntu 20.04 LTS on KVM servers. If you are trying to install on another environment, like Debian, or some container or otherwise, you will likely run into problems...
If you are using un-supported environments, that is complete at-your-own-risk.