Sudden error on Nextcloud Server

Hello All

First: i am a massive fan of Nextcloud! It is awesome

So i have Nextcloud (13) and sudden i get a error in the browser when attempting to load the login page.

require_once DIR . ‘/lib/versioncheck.php’;

try {

require_once DIR . ‘/lib/base.php’;

OC::handleRequest();

} catch(\OC\ServiceUnavailableException $ex) {
\OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’));

//show the user a detailed error page
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
OC_Template::printExceptionErrorPage($ex);
} catch (\OC\HintException $ex) {
OC_Response::setStatus(OC_Response::STATUS_SERVICE_UNAVAILABLE);
try {
OC_Template::printErrorPage($ex->getMessage(), $ex->getHint());
} catch (Exception $ex2) {
\OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’));
\OC::$server->getLogger()->logException($ex2, array(‘app’ => ‘index’));

//show the user a detailed error page
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
OC_Template::printExceptionErrorPage($ex);
}
} catch (\OC\User\LoginException $ex) {
OC_Response::setStatus(OC_Response::STATUS_FORBIDDEN);
OC_Template::printErrorPage($ex->getMessage(), $ex->getMessage());
} catch (Exception $ex) {
\OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’));

//show the user a detailed error page
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
OC_Template::printExceptionErrorPage($ex);
} catch (Error $ex) {
try {
\OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’));
} catch (Error $e) {

$claimedProtocol = strtoupper($_SERVER[‘SERVER_PROTOCOL’]);
$validProtocols = [
‘HTTP/1.0’,
‘HTTP/1.1’,
‘HTTP/2’,
];
$protocol = ‘HTTP/1.1’;
if(in_array($claimedProtocol, $validProtocols, true)) {
$protocol = $claimedProtocol;
}
header($protocol . ’ 500 Internal Server Error’);
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 $e;
}
OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR);
OC_Template::printExceptionErrorPage($ex);
}

It looks like maybe a issue with PHP?

I ran this commend: sudo apt-get install php7.0-fpm php7.0-mysql php7.0-common php7.0-gd php7.0-json php7.0-cli php7.0-curl libapache2-mod-php7.0

now i only get a blank white screen.

Any ideas?

Thanks

So you upgraded php. Which version of php was running before? Are there some packages missing? Do a
dpkg -l | grep php
Anything in your apache error log?

There is no errors in the apache log.
i dont remember seeing PHP in the updates recently but it is possible i accidentally updated.

dpkg -l | grep php

This is showing i have versions 7.0, 7.1, and 7.2. So i would have to think the last working version was 7.1.

Is there something i can run to make nextcloud use php 7.2 ? or should i uninstall it?

Thanks

You can leave the other versions installed. The php version used by nextcloud is selected by the apache module. I have php7.1.conf and php7.1.load in /etc/apache2/mods-enabled/. For this, libapache2-mod-php7.1 should be installed by apt.

1 Like

after messing around for a while trying to make it work, i ended up purging all php from the system and reinstalling php 7.2 looks to be working fine so far. Thanks for all your help.