'Internal Server Error' since upgrading Ubuntu to 22.04 (from 20.04)

I have upgraded Ubuntu from 20.04.6 LTS to 22.04.4 LTS, but now Nextcloud shows the following error…

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.

Before upgrading Ubuntu, I had the following versions:

Nextcloud version: 25.0.13.2
Operating system and version: Ubuntu 20.04.6 LTS
Apache or nginx version: Apache 2.4.41
PHP version: PHP 7.4.3

After upgrading Ubuntu, Apache2 stopped working but I fixed this by running the following commands:

sudo a2dismod php7.4
sudo a2enmod php8.1

What is causing the error with Nexccloud and how can I fix it ?

The Nextcloud app (on my Mac) shows this error…

So is it something to do with php ?

We have no idea (that’s just generic error message). You’ll have to check your Nextcloud log (nextcloud.log in your data directory unless you’ve changed it from the default location).

Though if I had to guess: PHP version mismatches and/or missing needed PHP extension. That’s the most common thing that arises when doing an OS upgrade.

If you search the forum, you will find many posts covering exactly the same situation (upgrading Ubuntu) and the steps people took to resolve.

The issue was missing PHP modules.

I listed the installed modules using…

php -m

And then looked at the modules Nextcloud requires…

https://docs.nextcloud.com/server/latest/admin_manual/installation/php_configuration.html

I had to manually install the missing php modules as follows…

sudo apt update && sudo apte upgrade
sudo apt install php-curl
sudo apt install php-dom
sudo apt install php-mbstring
sudo apt install php-gd
sudo apt install php-zip
sudo apt install php-mysql

Nextcloud is now up and running :slight_smile:

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.