I am running a small Ubuntu Server within my home network with various web services like vaultwarden, nextcloud, seeddms, etc. on it using a nginx web server. I had multiple PHP versions installed, but only was using PHP 7.4 for nginx. So I decided to purge all installed PHP versions to clean everything a little bit up and only installing PHP 8.1 with all needed php8.1 extensions like php8.1-fpm etc. Of course I changed the config of nginx to use the newly installed php8.1 version.
Now here comes the problem. I really don't know why this is happening or rather what led to it, but the php8.1-fpm
service isn't able to properly start anymore since my local PHP cleanup.
The command sudo systemctl start php8.1-fpm
gives me following error message:
Image may be NSFW.
Clik here to view.
I found out that when I create a folder named php
manually within the path /var/run/
, I am able to start the service successfully, but this is only working until the next boot, than the same thing happens over again. After booting it is the same error. The manually created folder /var/run/php
is not there anymore.
I know that /var/run
is a temporary folder location, but something must be wrong with my installation because why does not the php
folder gets created at startup or something like that by default. I never had to deal with this before.
There are some threads out there with similar error messages but they weren't helpful in my case. Currently I am using a workaround by creating that folder by a script at startup but that really isn't a nice solution and I really don't want to leave it like that it would be bad practice, so please no workaround solutions. I want to find the underlying reason of the problem.
Some further information (command outputs, config files etc.) which can help you to find the problem:
Results of php -v
:
PHP 8.1.14 (cli) (built: Jan 6 2023 15:23:18) (NTS)Copyright (c) The PHP GroupZend Engine v4.1.14, Copyright (c) Zend Technologieswith Zend OPcache v8.1.14, Copyright (c), by Zend Technologies
Results of update-alternatives --list php
:
/usr/bin/php8.1
Results of sudo nano /lib/systemd/system/php8.1-fpm.service
:
[Unit]Description=The PHP 8.1 FastCGI Process ManagerDocumentation=man:php-fpm8.1(8)After=network.target[Service]Type=notifyExecStart=/usr/sbin/php-fpm8.1 --nodaemonize --fpm-config /etc/php/8.1/fpm/php-fpm.confExecStartPost=-/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.1/fpm/pool.d/www.conf 81ExecStopPost=-/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/8.1/fpm/pool.d/www.conf 81ExecReload=/bin/kill -USR2 $MAINPID[Install]WantedBy=multi-user.target
Results of systemctl start php8.1-fpm
:
Job for php8.1-fpm.service failed because the control process exited with error code.See "systemctl status php8.1-fpm.service" and "journalctl -xeu php8.1-fpm.service" for details.
Results of sudo journalctl -xeu php8.1-fpm.service
:
Image may be NSFW.
Clik here to view.
If you need to see some config files or the results of different commands let me know and I will post them here.