New Nextcloud Server Incorrect PHP Version

Nextcloud version (eg, 10.0.2): 12.0.3
Operating system and version (eg, Ubuntu 16.04): Ubuntu 16.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.18
PHP version (eg, 5.6): 7.0.22

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

First time I’ve installed Nextcloud.

But I found another individual with the same issue: Wrong PHP Version?

Although I am using a clean browser so our problems cannot be the same cause.

The issue you are facing:

I am at the stage when I should be able to complete the installation graphically. All prerequisites were completed successfully (as far as I can tell).

Upon visiting the server in browser I receive this in HTML:

  • @author Lukas Reschke * @author Morris Jobke * @author Robin Appelman * @author Thomas Müller * @author Vincent Petry * * @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 * */ // Show warning if a PHP version below 5.6.0 is used, this has to happen here // because base.php will already use 5.6 syntax. if (version_compare(PHP_VERSION, ‘5.6.0’) === -1) { echo ‘This version of Nextcloud requires at least PHP 5.6.0
    ’; echo 'You are currently running ’ . PHP_VERSION . ‘. Please update your PHP version.’; return; } // Show warning if PHP 7.2 is used as Nextcloud is not compatible with PHP 7.2 for now // @see if (version_compare(PHP_VERSION, ‘7.2.0’) !== -1) { echo ‘This version of Nextcloud is not compatible with PHP 7.2.
    ’; echo 'You are currently running ’ . PHP_VERSION . ‘.’; return; } 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); OC_Template::printErrorPage($ex->getMessage(), $ex->getHint()); } 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) { \OC::$server->getLogger()->logException($ex, array(‘app’ => ‘index’)); OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); OC_Template::printExceptionErrorPage($ex); }

The output of your Nextcloud log in Admin > Logging:

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

Not configured since installation had not been completed.

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

How have you installed the server software?

This is the typical case, if your webservers PHP module is not running correctly. Your intention is to use mod_php I guess?

apt install libapache2-mod-php

was done with all dependencies?

/etc/apache2/mods-enabled/php7.0.load and
/etc/apache2/mods-enabled/php7.0.conf are there?
Otherwise try a2enmod php7.0.

Can you access other php pages, e.g. phpinfo.php according to