0

I just upgraded my Raspbian Pi from Wheezy to Stretch, and all of my Apache web pages are broken.

For example, my Nextcloud webpage literally looks like this:

enter image description here

(This is the text:)

* @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; } 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 Tiny Tiny RSS page shows the following error

Fatal Error: You forgot to copy config.php-dist to config.php and edit it.\n"; exit; } // we need a separate check here because functions.php might get parsed // incorrectly before 5.3 because of :: syntax. if (version_compare(PHP_VERSION, '5.3.0', '<')) { print "Fatal Error: PHP version 5.3.0 or newer required.\n"; exit; } set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR . get_include_path()); require_once "autoload.php"; require_once "sessions.php"; require_once "functions.php"; require_once "sanity_check.php"; require_once "version.php"; require_once "config.php"; require_once "db-prefs.php"; require_once "lib/Mobile_Detect.php"; $mobile = new Mobile_Detect(); if (!init_plugins()) return; if (!$_REQUEST['mobile']) { if ($mobile->isTablet() && PluginHost::getInstance()->get_plugin("digest")) { header('Location: backend.php?op=digest'); exit; } else if ($mobile->isMobile() && PluginHost::getInstance()->get_plugin("mobile")) { header('Location: backend.php?op=mobile'); exit; } else if ($mobile->isMobile() && PluginHost::getInstance()->get_plugin("digest")) { header('Location: backend.php?op=digest'); exit; } } login_sequence(); header('Content-Type: text/html; charset=utf-8'); ?>
get_hooks(PluginHost::HOOK_TOOLBAR_BUTTON) as $p) { echo $p->hook_toolbar_button(); } ?>

And Nagios says You don't have permission to access /nagios3/< on this server. and a bunch of visual artefacts.

I searched the web, and some of this may be fixed by installing php, but I think this is already installed.

 $ dpkg -l php
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                 Version         Architecture    Description
+++-====================-===============-===============-=============================================
ii  php                  1:7.0+49        all             server-side, HTML-embedded scripting language

How can I fix my Apache pages?

0

I think this was related to the upgrade of php from version 5 to 7.0. I looked at /etc/apache2/mods-enabled. This previously contained the php5 module, which was now absent and not even available. I fixed the errors with:

sudo a2enmod php7.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.