Nextcloud doesnt recognize php 8.4

Hello,

my nextcloud (Nextcloud Hub 26 Spring (34.0.4)) is running on a Debian 13 with nginx. i got a warning that i only installed php 8.2, but i got 8.4 installed too

root@XXX:/home/XXX# php -version
PHP 8.4.25 (cli) (built: Aug 28 2026 07:29:53) (NTS)
Copyright (c) The PHP Group
Built by Debian

so i tried to fix the /etc/nginx/conf.d/nextcloud.conf.

Both solution i found on the net

fastcgi_pass unix:/run/php/php8.4-fpm.sock;

#upstream php {

server unix:/run/php/php8.4-fpm.sock;

}

wont work.

after comment out both, i got problems restarting nginx

Sep 21 14:03:49 XXX systemd[1]: Starting nginx.service - nginx - high performance web server…
Sep 21 14:03:49 XXX nginx[86459]: nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /etc/nginx/conf.d/nextcloud.conf:2
Sep 21 14:03:49 XXX nginx[86459]: nginx: [warn] the “listen … http2” directive is deprecated, use the “http2” directive instead in /etc/nginx/conf.d/nextcloud.conf:3
Sep 21 14:03:49 XXX nginx[86459]: nginx: [emerg] “fastcgi_pass” directive is not allowed here in /etc/nginx/conf.d/nextcloud.conf:136
Sep 21 14:03:49 XXX systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE
Sep 21 14:03:49 XXX systemd[1]: nginx.service: Failed with result ‘exit-code’.
Sep 21 14:03:49 XXX systemd[1]: Failed to start nginx.service - nginx - high performance web server.

dont wanna make a bigger mess by testing, so i guess im asking for help :wink:

I think your config for nginx should contain

upstream php-handler {
server unix:/run/php/php8.4-fpm.sock;
}

instead of

#upstream php-handler {
server unix:/run/php/php8.4-fpm.sock;
}

(uncomment upstream…)

and second http2 directive concerned e.g.

server {
listen 443 ssl;
server_name YOUR.SERVER.NAME;

http2 on;

instead of

server {
listen 443 ssl http2;
server_name YOUR.SERVER.NAME;

hope it helps

thanks for your help :slight_smile:

first part was uncomment once but then i got

nginx[5548]: nginx: [emerg] “upstream” directive is not allowed here in /etc/nginx/conf.d/nextcloud.conf:141

then i moved it to /etc/nginx/nginx.conf, but no effect there

changed second part, warning gone, thanks.

if you got a solution for the first part, you will be my hero of the week :wink:

I don’t know your whole nextcloud.conf for nginx, but the php-handler should be above all server sections!

here an example

#nextcloud.conf
upstream php-handler {
server unix:/run/php/php8.4-fpm.sock;
}
.....

server {
listen 80 default_server;
server_name YOUR-SERVER-NAME;
root /var/www;

.....

server {
listen 443 ssl;
server_name YOUR.SERVER.NAME;

http2 on;
.....

In my case i put the nextcloud.conf as one of other configs into path
/etc/nginx/conf.d/*.* (like yours!)

You can not have a upstream php-handler in a server block like

server {

 ... upstream nextcloud_backend 

     { ... 
   } 
}


Your error message says that you put the upstream … in a section that nginx does not accept at this place.

And 141 says that the error seems to occur in line 141 of your conf file.
Seems to be placed far away from the beginning of your file :wink:

thanks a lot for your help, but the problems wont stop :wink:

first i moved the php-handler from 141 to the top. after a

nginx: [emerg] duplicate upstream “php-handler” in /etc/nginx/conf.d/nextcloud.conf:

i found another one in the http.conf. after deleting this one i was able to start nginx

nginx.service - nginx - high performance web server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
Active: active (running) since Fri 2026-09-25 16:03:04 CEST; 2s ago

but i guess the hope for a relaxing weekend was to soon, cause now i cant access nextcloud

Internal Server Error

The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.

nextcloud.log didnt show me any reason.

error.log nginx:

2026/09/25 16:22:04 [error] 9562#9562: *18 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Class “OCA\DAV\Connector\Sabre\ExceptionLoggerPlugin” not found in /var/www/nextcloud/remote.php:40
Stack trace:
#0 /var/www/nextcloud/remote.php(154): handleException()
#1 {main}
thrown in /var/www/nextcloud/remote.php on line 40” while reading response header from upstream, client: xxx, server: xxx, request: “PROPFIND /remote.php/dav/files/xxx/ HTTP/1.1”, upstream: “fastcgi://unix:/run/php/php8.4-fpm.sock:”, host: “xxx”

im confused, please save my day :slight_smile:

This error comes from Nextcloud itself and not from nginx as far as i can see.

The file nextcloud is searching for should be part of the DAV-App
and should be located in path

/var/www/nextcloud/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php

Is this file there?

what do you get by command

ls -la /var/www/nextcloud/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php

Do you have a mixed php install?
You should be sure that only one php8.x is installed (8.4 should be good for NC 34.x)

A mix of php versions 8.2 and 8.4 with also a mix of modules opens a wide range for errors and exceptions.

Clear at first your php environment and double check if all needed php modules are installed as well

Eliminate any php8.2 module and check if

apt install -y php-common \
php8.4-{fpm,gd,curl,xml,zip,intl,mbstring,bz2,ldap,apcu,bcmath,gmp,imagick,igbinary,mysql,redis,smbclient,sqlite3,cli,common,opcache,readline}

installs missing modules!

Check manual

If php is “clean” make a reboot of the server. Check if nginx is started, php8.4 is started and if

sudo -u www-data php /var/www/nextcloud/occ setup -vvv

gives any errors!

Before we go on a wild goose chase, are you using the officially provided Nginx configuration?

Sometimes IT is a funny thing… apt purge php8.2* was the key. Server is running again without any errors, php8.4 is recognized by nextcloud, couldnt be more happy.

thanks a lot for your great and patient help :slight_smile:

kind of :wink:

but it was running for years without and troubles, till php8.4 came :smiley:

@tim11

why not trying this very helpful tool next time you’d need to upgrade php?

thanks, ill give it a try. but im afraid i have to reopen this issue. after a regular reboot at night, nextcloud gives me troubles again. this time bad gateway 502. nextcloud.log and php8.4-fpm.log without problems. error.log on nginx gives me

2026/09/29 08:14:10 [crit] 4739#4739: 4 connect() to unix:/run/php/php8.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.XXX, server: XXX, request: “GET / HTTP/2.0”, upstream: “fastcgi://unix:/run/php/php8.4-fpm.sock:”, host: “XXX”

host is online

root@XXX:/etc/nginx/conf.d# ping XXX
PING XXX (127.0.1.1) 56(84) bytes of data.
64 bytes from XXX (127.0.1.1): icmp_seq=1 ttl=64 time=0.054 ms
64 bytes from XXX (127.0.1.1): icmp_seq=2 ttl=64 time=0.041 ms
64 bytes from XXX (127.0.1.1): icmp_seq=3 ttl=64 time=0.042 ms

i didnt do any changes after last entry, nextcloud.conf still starts with

upstream php-handler {
server unix:/run/php/php8.4-fpm.sock;
}

server {
listen 443 ssl;
server_name XXX;
http2 on;

new week, new problems :smiley:

check your php8.4 status

systemctl status php8.4-fpm --no-pager

failures / inactive?

which sockets are running?
ls -la /run/php/

“no such file or dir…” could mean
file *.sock isn’t really there or it is named in a different way!

many thanks :slight_smile:

Status:

× php8.4-fpm.service - The PHP 8.4 FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php8.4-fpm.service; enabled; preset: enabled)
Active: failed (Result: exit-code) since Tue 2026-09-29 04:59:39 CEST; 13h ago
Invocation: 11e4776bcf694190937b411f17bcf836
Docs: man:php-fpm8.4(8)
Main PID: 2252 (code=exited, status=78)

Sep 29 04:59:39 XXX systemd[1]: php8.4-fpm.service: Scheduled restart job, restart counter is at 5.
Sep 29 04:59:39 XXX systemd[1]: php8.4-fpm.service: Start request repeated too quickly.
Sep 29 04:59:39 XXX systemd[1]: php8.4-fpm.service: Failed with result ‘exit-code’.
Sep 29 04:59:39 XXX systemd[1]: Failed to start php8.4-fpm.service - The PHP 8.4 FastCGI Process Manager.

ls:

0

drwxr-xr-x 2 www-data www-data 40 29. Sep 04:59 .
drwxr-xr-x 27 root root 800 29. Sep 18:25 ..

so exit code 78 often means a config error in your php config.
That why php8.4-fpm does not start and run and so the socket is not present!

Investigate what causes the php error

sudo php-fpm8.4 -t

(which line of your php config contains the misconfiguration)

maybe you get something like this

ERROR: failed to open configuration file … ERROR: unable to bind listening socket … ERROR: failed to load configuration file … ERROR: unknown entry …

also give us the output of

sudo journalctl -u php8.4-fpm --since "2026-09-29 04:50" --until "2026-09-29 05:05" --no-pager

and

sudo systemctl status php8.4-fpm --no-pager -l

…
after that we’ll see what we can do.

First one:

[30-Sep-2026 18:04:56] NOTICE: configuration file /etc/php/8.4/fpm/php-fpm.conf test is successful

second:

Sep 29 04:59:38 XXX systemd[1]: php8.4-fpm.service: Main process exited, code=exited, status=78/CONFIG
Sep 29 04:59:38 XXX systemd[1]: php8.4-fpm.service: Failed with result ‘exit-code’.
Sep 29 04:59:38 XXX systemd[1]: Failed to start php8.4-fpm.service - The PHP 8.4 FastCGI Process Manager.
Sep 29 04:59:39 XXX systemd[1]: php8.4-fpm.service: Scheduled restart job, restart counter is at 4.
Sep 29 04:59:39 XXX systemd[1]: Starting php8.4-fpm.service - The PHP 8.4 FastCGI Process Manager…
Sep 29 04:59:39 XXX php-fpm8.4[2252]: [29-Sep-2026 04:59:39] ERROR: [/etc/php/8.4/fpm/pool.d/www.conf:461] value is NULL for a ZEND_INI_PARSER_ENTRY
Sep 29 04:59:39 XXX php-fpm8.4[2252]: [29-Sep-2026 04:59:39] ERROR: Unable to include /etc/php/8.4/fpm/pool.d/www.conf from /etc/php/8.4/fpm/php-fpm.conf at line 461
Sep 29 04:59:39 XXX php-fpm8.4[2252]: [29-Sep-2026 04:59:39] ERROR: failed to load configuration file ‘/etc/php/8.4/fpm/php-fpm.conf’
Sep 29 04:59:39 XXX php-fpm8.4[2252]: [29-Sep-2026 04:59:39] ERROR: FPM initialization failed
Sep 29 04:59:39 XXX systemd[1]: php8.4-fpm.service: Main process exited, code=exited, status=78/CONFIG
Sep 29 04:59:39 XXX systemd[1]: php8.4-fpm.service: Failed with result ‘exit-code’.
Sep 29 04:59:39 XXX systemd[1]: Failed to start php8.4-fpm.service - The PHP 8.4 FastCGI Process Manager.
Sep 29 04:59:39 XXX systemd[1]: php8.4-fpm.service: Scheduled restart job, restart counter is at 5.
Sep 29 04:59:39 XXX systemd[1]: php8.4-fpm.service: Start request repeated too quickly.
Sep 29 04:59:39 XXX systemd[1]: php8.4-fpm.service: Failed with result ‘exit-code’.
Sep 29 04:59:39 XXX systemd[1]: Failed to start php8.4-fpm.service - The PHP 8.4 FastCGI Process Manager.

Before checking line 461, i’ll wait on your opition :wink:

and the last one:

● php8.4-fpm.service - The PHP 8.4 FastCGI Process Manager
Loaded: loaded (/usr/lib/systemd/system/php8.4-fpm.service; enabled; preset: enabled)
Active: active (running) since Wed 2026-09-30 04:59:38 CEST; 13h ago
Invocation: 0c970eea530f4ff482617e87ecad8426
Docs: man:php-fpm8.4(8)
Process: 1880 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.4/fpm/pool.d/www.conf 84 (code=exited, status=0/SUCCESS)
Main PID: 1765 (php-fpm8.4)
Status: “Processes active: 0, idle: 3, Requests: 773, slow: 0, Traffic: 0.00req/sec”
Tasks: 4 (limit: 18777)
Memory: 167M (peak: 338.7M)
CPU: 46.942s
CGroup: /system.slice/php8.4-fpm.service
├─ 1765 “php-fpm: master process (/etc/php/8.4/fpm/php-fpm.conf)”
├─ 1879 “php-fpm: pool www”
├─ 9225 “php-fpm: pool www”
└─10849 “php-fpm: pool www”

Sep 30 04:59:37 XXX systemd[1]: Starting php8.4-fpm.service - The PHP 8.4 FastCGI Process Manager…
Sep 30 04:59:38 XXX systemd[1]: Started php8.4-fpm.service - The PHP 8.4 FastCGI Process Manager.

thanks :slight_smile:

i checked line 461, copied the line from an older backup version, now its running again without problem. i compared both lines and couldnt find any difference, but somehow it worked after that.

thank you so much for your help. i hope tomorrow there will no new surprises with the next boot at 5 am :smiley: