Internal Server Error after updating PHP version

Nextcloud version (eg, 20.0.5): Nextcloud 24.0.12.1
Operating system and version (eg, Ubuntu 20.04): Raspbian GNU/Linux 10 (buster)
Apache or nginx version (eg, Apache 2.4.25): Nginx 1.14.2
PHP version (eg, 7.4): PHP 8.1.20 (cli) (built: Jun 9 2023) → recently updated

The issue you are facing:
After PHP update I get an internal server error and cannot access my nextcloud any more.

I use a Raspberrry Pi 4 to host my Nextcloud, running on Raspbian 10 with Nginx reverse proxy and some letsencrypt certificates. To be able to update my Nextcloud from 24 to newer versions, I updated my PHP version to 8.1 and adopted all relevant config.php files. Since the moment of trying to reaccess my Nextcloud instance, I get an “Internal Server Error” which I never had before.

I am quite sure that the Nginx and vHost configs are fine, as nothing was changed here except the PHP version. Also, the Nginx logs are completely empty and the access erquest is visible in the neginx access.log.

Unfortunately, I am not able to show any nextcloud logs because there are none… I tried to find them on all possible places and I was not able to find anything. I am not sure if a simple swith-back to PHP 7.4 will help, but even if it would, I am wondering why there is such a hassle.

Thanks a lot in advance for any hints and tips where to look for or how to approach the issue!! :heart:

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

The output of your Nextcloud log in Admin > Logging:

No access to Nextcloud any more -> no log available

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

<?php
$CONFIG = array (
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 'xxx',
  'datadirectory' => '/var/nextcloud_data',
  'dbtype' => 'mysql',
  'version' => '24.0.12.1',
  'overwrite.cli.url' => 'xxx',
  'dbname' => 'xxx',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'overwriteprotocol' => 'https',
  'logtimezone' => 'Europe/Berlin',
  'auth.bruteforce.protection.enabled' => false,
  'filelocking.enabled' => 'true',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),
  'maintenance' => true,
  'theme' => '',
  'loglevel' => 2,
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud log',
  'logdateformat' => 'F d, Y H:i:s',
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'xxx',
  'mail_domain' => 'web.de',
  'mail_smtphost' => 'smtp.web.de',
  'mail_smtpport' => '587',
  'mail_smtpauth' => 1,
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'mail_smtpsecure' => 'tls',
  'default_phone_region' => 'DE',
  'app_install_overwrite' =>
  array (
    0 => 'calendar',
  ),
  'updater.secret' => 'xxx',
);

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

No errors occuring!

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.

Unfortunately no Nextcloud log file available - I have no idea why!

Based on your config the log should be here:

/var/log/nextcloud log

But I suspect that’s not working since it has a typo in it. Change the space to a period. :slight_smile:

You mentioned you’re using Nginx as a proxy, but your config doesn’t indicate a proxy in use. I point this out because it’s unclear what mode you’re running PHP in. Assuming it’s not FPM and that you have Apache somewhere in there (because NGINX would otherwise require FPM).

1 Like

Jup, I already corrected that in the meantime as you suggested, so I should have a Nextcloud Log in the future. Thanks for the hint @jtr :slight_smile: !

After some further digging, I just decided to completely remove/purge all PHP stuff and reinstall everything again. Surprisingly, that solved the issue. I have the theory that something with PHP-FPM went wrong. the command php -v gave me the right version and also the php -m command listeed the correct modules, so I still have no idea what went wrong.

1 Like