Internal Server Error after Update to PHP8.0

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 25.0.13
Operating system and version (eg, Ubuntu 20.04): Debian 11
Apache or nginx version (eg, Apache 2.4.25): 2.4.56
PHP version (eg, 7.4): 8.0

The issue you are facing:
After upgrading to PHP8.0 I get “Internal Server Error”

Is this the first time you’ve seen this error? (Y/N): Y

The output of your Nextcloud log in Admin > Logging:

cannot access GUI

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'XXXXX',
  'passwordsalt' => 'XXXXX',
  'secret' => 'XXXXX',
  'trusted_domains' =>
  array (
    0 => 'XXXXX.cloud',
  ),
  'datadirectory' => '/var/www/nextcloud_data',
  'overwrite.cli.url' => 'https://XXXXX.cloud',
  'dbtype' => 'mysql',
  'version' => '25.0.13.2',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => 'XXXXX',
  'installed' => true,
  'maintenance' => false,
  'default_language' => 'de',
  'theme' => '',
  'loglevel' => 1,
  'app_install_overwrite' =>
  array (
    0 => 'calendar',
    1 => 'onlyoffice',
    2 => 'spreed',
    3 => 'integration_moodle',
  ),
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'cloud',
  'mail_domain' => 'XXXXX',
  'mail_smtpport' => '587',
  'preview_max_x' => 2000,
  'preview_max_y' => 2000,
  'mysql.utf8mb4' => true,
  'default_phone_region' => 'AT',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '127.0.0.1',
    'port' => 6379,
    'timeout' => 3,
  ),
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'mail_smtphost' => '192.168.222.3',
);


The output of your Apache/nginx/system log in /var/log/____:

error.log

[Thu Mar 28 19:21:19.817091 2024] [mpm_prefork:notice] [pid 3002] AH00170: caught SIGWINCH, shutting down gracefully
[Thu Mar 28 19:21:19.928500 2024] [ssl:warn] [pid 7718] AH01909: SRV-CLOUD1.XXXXX:443:0 server certificate does NOT include an ID which match>
[Thu Mar 28 19:21:19.997189 2024] [ssl:warn] [pid 7719] AH01909: SRV-CLOUD1.XXXXX:443:0 server certificate does NOT include an ID which match>
[Thu Mar 28 19:21:20.007893 2024] [mpm_prefork:notice] [pid 7719] AH00163: Apache/2.4.56 (Debian) OpenSSL/1.1.1w configured -- resuming normal operations
[Thu Mar 28 19:21:20.008003 2024] [core:notice] [pid 7719] AH00094: Command line: '/usr/sbin/apache2'

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

no entries since PHP Update

Thanks in advance
Gerald

no entries since PHP Update

Are you sure you’re checking /var/www/nextcloud_data/nextcloud.log? An internal server error - at least if it’s getting as far as Nextcloud - will show some clues there.

After upgrading to PHP8.0 I get “Internal Server Error”

Chances are you’re missing some PHP modules or something like that. Installing a new PHP version means you have to install all the required upgraded modules again too.

Yes. '/var/www/nextcloud_data/nextcloud.log` does not show anything

Before I upgraded I wrote down the modules I had under PHP7.4. Here they are:
php7.4-bcmath/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-bz2/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-cli/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-common/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-curl/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-gd/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-gmp/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-intl/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-json/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-ldap/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-mbstring/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-mysql/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-opcache/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-readline/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-xml/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-zip/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4/oldstable,oldstable-security,now 7.4.33-1+deb11u4 all [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]

I updated every module one by one.

apt install php8.0-json

returned:
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
Package php8.0-json is a virtual package provided by:
php8.0-phpdbg 1:8.0.30-2+0~20230904.59+debian11~1.gbp806e95
php8.0-fpm 1:8.0.30-2+0~20230904.59+debian11~1.gbp806e95
php8.0-cli 1:8.0.30-2+0~20230904.59+debian11~1.gbp806e95
php8.0-cgi 1:8.0.30-2+0~20230904.59+debian11~1.gbp806e95
libphp8.0-embed 1:8.0.30-2+0~20230904.59+debian11~1.gbp806e95
libapache2-mod-php8.0 1:8.0.30-2+0~20230904.59+debian11~1.gbp806e95
You should explicitly select one to install.

E: Package ‘php8.0-json’ has no installation candidate

…could that be the cause?

You must have had other PHP modules, since you’re using Redis (as one example).

https://docs.nextcloud.com/server/latest/admin_manual/installation/php_configuration.html#php-modules

Though an internal server error has to be getting logged somewhere. Are entries with 500 error codes at least showing up in your Apache access log?

Well, before upgrading I did:

apt list --installed | grep php7.4

that returned:
libapache2-mod-php7.4/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-bcmath/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-bz2/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-cli/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-common/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-curl/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-gd/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-gmp/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-intl/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-json/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-ldap/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-mbstring/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-mysql/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-opcache/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-readline/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-xml/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4-zip/oldstable,oldstable-security,now 7.4.33-1+deb11u4 amd64 [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]
php7.4/oldstable,oldstable-security,now 7.4.33-1+deb11u4 all [installed,upgradable to: 1:7.4.33-8+0~20230904.88+debian11~1.gbp87c414]

Yes, the access.log shows the following lines:
192.168.2.3 - - [29/Mar/2024:21:58:47 +0100] “GET / HTTP/1.1” 500 4435 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0”
192.168.2.3 - - [29/Mar/2024:21:58:47 +0100] “GET /favicon.ico HTTP/1.1” 500 1273 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0”

Maybe some of the ones you were previously using were installed outside of package management. Either way, you can check through the list in the docs and see what’s missing.

Though I’m still not sure why you’re not seeing more log info somewhere. Wait, are you using FPM?