Nextcloudpi (NCP) down with fatal php error

My NCP is down with a fatal php error.

system-information of my Pi:

NextCloudPi version  v1.11.2
NextCloudPi image    NextCloudPi_10-05-18
distribution         Raspbian GNU/Linux 9 \n \l
automount            yes
USB devices          none
datadir              /var/www/nextcloud/data
data in SD           yes
data filesystem      ext2/ext3
data disk usage      52G/60G
rootfs usage         52G/60G
swapfile             /var/swap
dbdir                /var/lib/mysql
Nextcloud check      error
HTTPD service        up
PHP service          down
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): Y

How to see my problem:
visit my nextcloud via browser
type ncp-report and it says:
sudo: php: command not found

I allready tried this solution, but it seems not to help:

Any ideas to solve the problem? Thanks.

I reinstalled php7.2-fpm, but now this error occurs:

PHP Fatal error:  Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: An exception occured in driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:64

Someone knows a solution? Thanks a lot.

Looks like the php modul for the DB connections is either not installed yet or not activated.
Can you provide the output of
php -m

and also let us know which DB is used (MySQL, MariaDB, PostgreSQL)?

As far as I remember from other postings related to this message, you need to install the correct database driver package, e.g. php72-mysql etc., to get rid of the message. Using the search function you find several matches:

https://help.nextcloud.com/search?q=php%207.2%20Failed%20to%20connect%20to%20the%20database

php -m gives this:

[PHP Modules]
calendar
Core
ctype
date
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
openssl
pcntl
pcre
PDO
Phar
posix
readline
Reflection
session
shmop
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

I use mysql.

As you suggested I now installed the driver via:

sudo apt-get install php7.2-mysql

Now I get this message

´´´
An unhandled exception has been thrown:
Error: Call to undefined function OC\App\simplexml_load_file() in /var/www/nextcloud/lib/private/App/InfoParser.php:64
´´´

Thanks for your reply.

Hi,

Looks like your issue is coming from a PHP update to 7.2 and that update didn’t install all the PHP modules which were installed before with the older PHP version.

Please check the admin manual and install all required PHP modules:
https://docs.nextcloud.com/server/15/admin_manual/installation/source_installation.html?highlight=simplexml#prerequisites-for-manual-installation

Please also check the other modules (“recommended” and “required for specific apps”) if you need them as well and install these modules, if so.

Thanks for your help.

I installed:

apt-get install apache2 mariadb-server libapache2-mod-php7.2

apt-get install php7.2-gd php7.2-json php7.2-mysql php7.2-curl php7.2-mbstring

apt-get install php7.2-intl php-imagick php7.2-xml php7.2-zip

While installing it says:

NOTICE: Not enabling PHP 7.2 FPM by default.

NOTICE: To enable PHP 7.2 FPM in Apache2 do:

NOTICE: a2enmod proxy_fcgi setenvif

NOTICE: a2enconf php7.2-fpm

NOTICE: You are seeing this message because you have apache2 package installed.

Is this normal?

ncp-report output:

NextCloudPi version  v1.11.2

NextCloudPi image    NextCloudPi_10-05-18

distribution         Raspbian GNU/Linux 9 \n \l

automount            yes

USB devices          none

datadir              /var/www/nextcloud/data

data in SD           yes

data filesystem      ext2/ext3

data disk usage      52G/60G

rootfs usage         52G/60G

swapfile             /var/swap

dbdir                /media/USBdrive/ncdatabase

Nextcloud check      ok

Nextcloud version    15.0.5.3

HTTPD service        up

PHP service          up

MariaDB service      up

Redis service        up

Postfix service      up

internet check       ok

port check 80        open

port check 443       open

IP                   ***REMOVED SENSITIVE VALUE***

gateway              ***REMOVED SENSITIVE VALUE***

interface            eth0

certificates         ***REMOVED SENSITIVE VALUE***

NAT loopback         no

uptime               3min

but my nextcloud ist not working

:astonished: but you had a web server and DB server already installed …
This is only about the PHP modules missing.

What are the latest log entries of nextcloud.log in your data directory?

{"reqId":"XKzIYn8AAQEAAASGDq4AAAAA","level":3,"time":"2019-04-09T16:29:22+00:00","remoteAddr":"89.247.45.48","user":"--","app":"remote","method":"GET","url":"\/status.php","message":{"Exception":"OC\\HintException","Message":"Memcache \\OC\\Memcache\\Redis not available for local cache","Code":0,"Trace":[{"file":"\/var\/www\/nextcloud\/lib\/private\/Server.php","line":511,"function":"__construct","class":"OC\\Memcache\\Factory","type":"->","args":["8151fbf6bb1b31cdc6724afd204049b8",{"__class__":"OC\\Log"},"\\OC\\Memcache\\Redis","\\OC\\Memcache\\Redis","\\OC\\Memcache\\Redis"]},{"file":"\/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php","line":117,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["OC\\Memcache\\Factory"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/ServerContainer.php","line":132,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OC\\Memcache\\Factory"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php","line":165,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OC\\Memcache\\Factory"]},{"file":"\/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php","line":114,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php","line":117,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["MemCacheFactory"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/ServerContainer.php","line":132,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["MemCacheFactory"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Server.php","line":1533,"function":"query","class":"OC\\ServerContainer","type":"->","args":["MemCacheFactory"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Server.php","line":697,"function":"getMemCacheFactory","class":"OC\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php","line":118,"function":"OC\\{closure}","class":"OC\\Server","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php","line":117,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["OC\\App\\AppManager"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/ServerContainer.php","line":132,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["OC\\App\\AppManager"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php","line":165,"function":"query","class":"OC\\ServerContainer","type":"->","args":["OC\\App\\AppManager"]},{"file":"\/var\/www\/nextcloud\/3rdparty\/pimple\/pimple\/src\/Pimple\/Container.php","line":114,"function":"OC\\AppFramework\\Utility\\{closure}","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/AppFramework\/Utility\/SimpleContainer.php","line":117,"function":"offsetGet","class":"Pimple\\Container","type":"->","args":["AppManager"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/ServerContainer.php","line":132,"function":"query","class":"OC\\AppFramework\\Utility\\SimpleContainer","type":"->","args":["AppManager"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/Server.php","line":1723,"function":"query","class":"OC\\ServerContainer","type":"->","args":["AppManager"]},{"file":"\/var\/www\/nextcloud\/lib\/private\/legacy\/app.php","line":342,"function":"getAppManager","class":"OC\\Server","type":"->","args":[]},{"file":"\/var\/www\/nextcloud\/lib\/private\/legacy\/app.php","line":113,"function":"getEnabledApps","class":"OC_App","type":"::","args":[]},{"file":"\/var\/www\/nextcloud\/lib\/base.php","line":654,"function":"loadApps","class":"OC_App","type":"::","args":[["session"]]},{"file":"\/var\/www\/nextcloud\/lib\/base.php","line":1068,"function":"init","class":"OC","type":"::","args":[]},{"file":"\/var\/www\/nextcloud\/status.php","line":36,"args":["\/var\/www\/nextcloud\/lib\/base.php"],"function":"require_once"}],"File":"\/var\/www\/nextcloud\/lib\/private\/Memcache\/Factory.php","Line":99,"Hint":"Is the matching PHP module installed and enabled?","CustomMessage":"--"},"userAgent":"Mozilla\/5.0 (Linux) mirall\/2.5.2git (Nextcloud)","version":"15.0.5.3"}

I guess php-redis is still missing. Run:
apt-get install php7.2-redis

Thanks for your help. Now it looks a little bit better.

But after a short uptime my nextcloud went into maintainance mode. This are the last log-file entries:

{"reqId":"XK113X8AAQEAACqb9PoAAAAC","level":3,"time":"2019-04-10T04:49:59+00:00","remoteAddr":"46.142.79.13","user":"--","app":"PHP","method":"GET","url":"\/index.php\/204","message":"session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (\/var\/lib\/php\/sessions) at \/var\/www\/nextcloud\/lib\/private\/Session\/Internal.php#207","userAgent":"Mozilla\/5.0 (Android) ownCloud-android\/3.5.0","version":"15.0.5.3"}
{"reqId":"XK113X8AAQEAACjTYbsAAAAk","level":3,"time":"2019-04-10T04:49:59+00:00","remoteAddr":"46.142.79.13","user":"--","app":"PHP","method":"GET","url":"\/index.php\/204","message":"session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (\/var\/lib\/php\/sessions) at \/var\/www\/nextcloud\/lib\/private\/Session\/Internal.php#207","userAgent":"Mozilla\/5.0 (Android) ownCloud-android\/3.5.0","version":"15.0.5.3"}
{"reqId":"XK113X8AAQEAACqVgKoAAAAB","level":3,"time":"2019-04-10T04:49:59+00:00","remoteAddr":"46.142.79.13","user":"--","app":"PHP","method":"GET","url":"\/index.php\/204","message":"session_write_close(): write failed: No space left on device (28) at \/var\/www\/nextcloud\/lib\/private\/Session\/Internal.php#207","userAgent":"Mozilla\/5.0 (Android) ownCloud-android\/3.5.0","version":"15.0.5.3"}
{"reqId":"XK114n8AAQEAACqgOcEAAAAD","level":3,"time":"2019

In the webinterface it says:

There are some warnings regarding your setup.

    The PHP OPcache is not properly configured. For better performance it is recommended to use the following settings in the php.ini:

    opcache.enable=1
    opcache.enable_cli=1
    opcache.interned_strings_buffer=8
    opcache.max_accelerated_files=10000
    opcache.memory_consumption=128
    opcache.save_comments=1
    opcache.revalidate_freq=1

    Some columns in the database are missing a conversion to big int. Due to the fact that changing column types on big tables could take some time they were not changed automatically. By running 'occ db:convert-filecache-bigint' those pending changes could be applied manually. This operation needs to be made while the instance is offline. For further details read the documentation page about this.
        filecache.mtime
        filecache.storage_mtime


Do you know also a solution for this?