Internal Server Error after update ubuntu 20.04.4

Nextcloud version 25.0.2.3
Operating system and version Ubuntu 20.04.4 LTS
Apache Apache 2.4.25
PHP version 8.0 8.1 8.2 8.3

The issue you are facing:

Is this the first time you’ve seen this error? Y
Steps to replicate it:

  1. try to update
  2. Everything checked

Apache Log:

[Sun Feb 18 17:14:10.210105 2024] [php:error] [pid 51071] [client 192.168.178.1:62137] PHP Parse error:  syntax error, unexpected token ";" in /home/vander-laan/domains/intranet.vander-laan.com/public_html/config/config.php on line 7

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

<?php
$CONFIG = array (
  'instanceid' => 'ocye0ux7ctva',
  'passwordsalt' => ***
  'secret' => ***
  'trusted_domains' => 
  array (
    0 => 'intranet.vander-laan.com',
  ),
  'datadirectory' => '/home/vander-laan/domains/intranet.vander-laan.com/public_html/data',
  'dbtype' => 'mysql',
  'version' => '25.0.2.3',
  'overwrite.cli.url' => ***
  'dbname' => 'intranet',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_root',
  'dbpassword' => ***
  'installed' => true,
);

I’m sorry, but I cannot replicate it with that sparse information.
What exactly did you update? A simple apt-get upgrade, a major Ubuntu release upgrade or only a Nextcloud update?
Step 2 is very generic but does not give any information at all!..

This message ist prety clear, it is about an
unexpected token ";" in /home/vander-laan/domains/intranet.vander-laan.com/public_html/config/config.php on line 7

but the (edited) config.php does not look like it has that “;” on line 7.

So what steps you did exactly before you got this error?


ernolf

I only did an apt upgrade and from then on nextcloud stopped working

I restored a backup config.php and now I get the site in text form, that’s how it started

<?php
/**
 * @copyright Copyright (c) 2016, ownCloud, Inc.
 *
 * @author Christoph Wurst <christoph@winzerhof-wurst.at>
 * @author Joas Schilling <coding@schilljs.com>
 * @author Jörn Friedrich Dreyer <jfd@butonic.de>
 * @author Lukas Reschke <lukas@statuscode.ch>
 * @author Morris Jobke <hey@morrisjobke.de>
 * @author Robin Appelman <robin@icewind.nl>
 * @author Roeland Jago Douma <roeland@famdouma.nl>
 * @author Sergio Bertolín <sbertolin@solidgear.es>
 * @author Thomas Müller <thomas.mueller@tmit.eu>
 * @author Vincent Petry <vincent@nextcloud.com>
 *
 * @license AGPL-3.0
 *
 * This code is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program. If not, see <http://www.gnu.org/licenses/>
 *
 */
require_once __DIR__ . '/lib/versioncheck.php';

try {
	require_once __DIR__ . '/lib/base.php';

	OC::handleRequest();
} catch (\OC\ServiceUnavailableException $ex) {
	\OC::$server->getLogger()->logException($ex, ['app' => 'index']);

	//show the user a detailed error page
	OC_Template::printExceptionErrorPage($ex, 503);
} catch (\OCP\HintException $ex) {
	try {
		OC_Template::printErrorPage($ex->getMessage(), $ex->getHint(), 503);
	} catch (Exception $ex2) {
		try {
			\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
			\OC::$server->getLogger()->logException($ex2, ['app' => 'index']);
		} catch (Throwable $e) {
			// no way to log it properly - but to avoid a white page of death we try harder and ignore this one here
		}

		//show the user a detailed error page
		OC_Template::printExceptionErrorPage($ex, 500);
	}
} catch (\OC\User\LoginException $ex) {
	$request = \OC::$server->getRequest();
	/**
	 * Routes with the @CORS annotation and other API endpoints should
	 * not return a webpage, so we only print the error page when html is accepted,
	 * otherwise we reply with a JSON array like the SecurityMiddleware would do.
	 */
	if (stripos($request->getHeader('Accept'), 'html') === false) {
		http_response_code(401);
		header('Content-Type: application/json; charset=utf-8');
		echo json_encode(['message' => $ex->getMessage()]);
		exit();
	}
	OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage(), 401);
} catch (Exception $ex) {
	\OC::$server->getLogger()->logException($ex, ['app' => 'index']);

	//show the user a detailed error page
	OC_Template::printExceptionErrorPage($ex, 500);
} catch (Error $ex) {
	try {
		\OC::$server->getLogger()->logException($ex, ['app' => 'index']);
	} catch (Error $e) {
		http_response_code(500);
		header('Content-Type: text/plain; charset=utf-8');
		print("Internal Server Error\n\n");
		print("The server encountered an internal error and was unable to complete your request.\n");
		print("Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.\n");
		print("More details can be found in the webserver log.\n");

		throw $ex;
	}
	OC_Template::printExceptionErrorPage($ex, 500);
}

IIf I run php index.php in a terminal I get the following but I don’t have php 8.2

php index.php
This version of Nextcloud is not compatible with PHP>=8.2.
You are currently running 8.3.3-1+ubuntu22.04.1+deb.sury.org+1.root@roadwarrior:/home/vander-laan/domains/intranet.vander-laan.

Do you use fpm?
Then run a2disconf php8.3-fpm and a2enconf php8.2-fpm and restart the apache2 service. Your default php version is 8.3 because the update installed it on your server

Are those the php Versions installed?

Tons of problems can arise when multiple php versions are installed.
Specialy if you have the meta- and dependecy packages installed.

Could you please install → the php-updater script ← and post the echo of

php-updater --list-installed

… and then you should thoroughly read the help:

php-updater --help

Much and good luck,
ernolf

sudo a2disconf php8.3-fpm
Conf php8.3-fpm already disabled

sudo a2enconf php8.2-fpm
ERROR: Conf php8.2-fpm does not exist!

I restarted Apache but notting happend

I only installed nc 28 on another domain from my own and it works now, but now I have another problem. When I want to log in to the mac with my nc client, I get the message “Access prohibited.”
State token mismatch"
Now I only find that it has been solved in nc 25, on my iPhone it works just fine with both http and https

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