'Internal Server Error' after accidental upgrade of PHP

Nextcloud version :
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04.5 LTS
Apache or nginx version : Apache 2.4.29
PHP version (eg, 7.4): 8.0.5

The issue you are facing:

When I try to access my Nextcloud URL the page states:

"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."

I accidentally upgraded PHP to 8.0, but have followed a few guides to disable 8.0 and enable 7.4, plus all of its required dependencies. I also accidentally upgraded MariaDB to 10.5.10. Using OCC, I can run commands on the database so it seems to be up and running.

Any idea what to do? I’m not all that literate with linux and Nextcloud, this instance is more of an experiment and opportunity to learn. I’ve been using it for 8+ months until this breakage (which actually occurred two months ago, only getting around to trying to fix it now).

Is this the first time you’ve seen this error? Yes

Steps to replicate it:

  1. Visit URL

The output of your Nextcloud log in Admin > Logging:

Can't access log, unsure where to find it? Using OCC or in a folder?

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


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


Hi @nextc1, to find nextcloud.log ( the log of nextcloud ) go inside your datadirectory ( by default /…/nextcloud/data/nextcloud.log) if you don’t have the location of your nextcloud server directory, here is the location: /var/www/nextcloud/data/nextcloud.log
Have you tried to install again all PHP modules?

1 Like

Thanks for your reply, Mageunic.

The nextcloud.log file in my data directory is some 12,000 lines long. Any idea how to get to what’s pertinent? It seems as if Nextcloud is somewhat active in the background - I can see that cron jobs are executing successfully.

I’ve reinstalled every PHP7.4 module, yes. All seem to be installed and php7.4 is enabled. Thanks again.

@nextc1 the most important are the message section and log level, like here :

{“reqId”:“pmnwjw1gnnmvaVPLQFUO”,“level”:3,“time”:“2021-05-30T18:37:01+02:00”,“remoteAddr”:"",“user”:"–",“app”:“integration_whiteboard”,“method”:"",“url”:"–",“message”:"[ERROR] Spacedeck …

log level :
0= debug
1= info
2= warning
3= error
4= fatal

You can ignore log which have level 0 and 1.

1 Like

Thanks again Mageunic.

After much searching (and changing my logging level to 3) I see that every level 3 error says that my redis server is not available for local caching. My redis server is up and running with no errors, it responds to a PING (with a PONG), and my nextcloud config.php is aligned with the server.

I’m running on no sleep now but will tomorrow post the relevant lines from the log and from my config - can’t figure out how to copy and paste a full line with nano! Thank you again for all your help.

1 Like

Here are the (very long) lines from my nextcloud.log after a refresh of my homepage URL (which still gives an internal server error message):

Here are the relevant lines from my config.php:

Some lines redacted. The instance worked perfectly with nothing but a green checkbox for 8+ months until I upgraded PHP and MariaDB by accident. My Redis server is running without any issues when I check with systemctl status, and when I ping it it responds with pong.

Problem solved. I had php-redis installed, but not php7.4-redis installed. Or I had it installed but it must have been autoremoved at some point…

1 Like