Pi, Nextcloud and APCu

Hi all

Raspberry Pi 3
Nextcloud version 12.0.3
Operating system and version:
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch
Apache version 2.4.25 (Raspbian)
PHP version 5.6.22-2+b3

My other problem is that I cannot find anything to activate the memcache in Nextcloud.

Anything to do with APC doesn’t seem to exist in the repositories.
I’ve even tried installing:
php-apcu-bc, which demanded installation of php7. Did so and it still didn’t work, in that I get Error 503 (server down) on the Pi itself, and a blank page on anything trying to connect.

config.php:

 <?php
 $CONFIG = array (
 'instanceid' => 'ocrtxgh6xns3',
 'passwordsalt' => '(lots of characters)',
 'secret' => '(lots more characters)',
 'trusted_domains' => 
  array (
  0 => '192.168.1.80',
  1 => 'www.alistairscloud.org',
  2 => 'alistairscloud.org',
  ),
 # 'memcache.local' => '\OC\Memcache\APCu',
 'datadirectory' => '/var/nextcloud/data',
 'overwrite.cli.url' => 'https://192.168.1.80/nextcloud',
 'dbtype' => 'sqlite3',
 'version' => '12.0.3.3',
 'installed' => true,
 'mail_smtpmode' => 'smtp',
 'mail_smtpauthtype' => 'LOGIN',
 );

Line 12 is remmed out as it is the cause of the server crash. If I knew how to get that to work, I would be very happy.
Does anyone know what program I require for php5 that is actually in the Raspbian repositories?
Fitch

Hi,

I am using Rapsbian Stretch by myself with APCu used by Nextcloud for memcache.

The problem with your environment is the following, as far as the information you provided is correct:

  • You use the Stretch repositories, which provide the package php-apcu. But this needs PHP7 to be installed, thus you should not even be able to install it with your PHP5 environment.
  • APCu for PHP5 is provided by the package php5-apcu, but this is just available via Jessie repo.
  • To solve your problem and gain general performance improvements and current PHP updates, I highly recommend you to switch to PHP7!

For this:

  • Do a system backup always before such changes :wink:.
  • Purge libapache2-mod-php5 and all related php packages.
  • Install PHP7: apt update && apt install libapache2-mod-php php-curl php-gd php-intl php-mbstring php-xml php-zip php-apcu

Further I highly recommend to use MariaDB(MySQL) as database. SQLite is just acceptable for single user environments or if nothing else is possible.

Great! At last a method to change to PHP7. I’m all for it.

Lets start at the beginning though…
What’s the best way to do a system backup on the Pi?
Bearing in mind, I have 2 networked computers and 4TB of NAS’s. Both my main HP desktop and the Pi have full GUI…
Just steer me to a backup app or something…

Hi,

Have you considered using NextCloudPi? You will save precious time configuring stuff and it comes with a backup/restore feature (and more).

That was the first thing I tried. Didn’t work…
So I’ve spent a week manually building Nextcloud, but the instructions were for PHP5.
Nextcloud works fine (except for a certificate niggle) but can be accessed from the outside world, albeit VERY slowly.
So PHP7 seems to be the way to go.
Found a USB stick, so copying everything to it now.

Can I ask what didn’t work?

There’s many many many people using it and they are quite happy. If something doesn’t work, you can report it and we’ll help you.

It is such hard work to set it up and so easy to make a mistake (security or otherwise), that’s why I started NCP.

Just my advice anyway :wink:

I’ve got another SD card, so I’ve put the image onto it and stuck it in.
Just as I did last week.

It’s just looking at me…
pi@nextcloudpi:~$

sudo raspi-config:
The boot partition is not mounted - cannot configure.
etc.etc.
I mounted /dev/mmcblk0
then raspi-config again.
Nothing selected would save.

Rebooted.
Nothing remembered.
Root is unmounted, read only.
No connection to internet either, but the router does see it and gives it a good address, and it will successfully ping out, but I cannot access it from another computer on the same router.

Sry for late reply. Of course NCP is a good solution which automates much configuration. As you see you will easily find help, as much people using it and @nachoparker is a great always helping and care taking developer :slight_smile:.

Anyway to answer your last question: For backups I just use the simple rsync: https://www.ostechnix.com/backup-entire-linux-system-using-rsync/

wow, this is really weird

either the SD card is wrong, or the Pi is wrong… what model is it? is it a british pi? do you have a good power supply?

NCP is literally built on top of Raspbian, so… do you see the same with Raspbian?

Raspberry Pi 3 Model B V1.2
British
6A PSU (one of these multiple fast charge thingies).

The SD card is the one that used to have Owncloud, and worked fine beforehand.
The original SD card still has the manually installed Nextcloud, (the one with PHP5 on it)…

My router assigns a static address of 192.168.1.80 to the Pi. Will this be a problem?

Well, if plain Raspbian works, NCP has to work, really weird. I suspect the 6A PSU is not adecuate, but it has to work or not work the same for both.

no, that’s fine

The PSU is fine. The cable is thick, and there is no flash on the screen.
I tried it again from start. Exactly the same outcome.
Maybe Linux can’t fat 32 the SD card properly when I load the image from my desktop, I don’t know, but the NCP ain’t going to work.
I’ll try the PHP7 install in post 2, but I can’t backup as the “backend” won’t let me.

Now that I’ve purged PHP5 and installed PHP7 as per post 2,
I get an “Error 500 Page isn’t working” on the Pi, and a blank page from anywhere else.
What has to be done to “unbreak” my cloud?

Here are a couple of lines:

[Tue Nov 07 18:46:53.481189 2017] [:error] [pid 782] [client 192.168.1.64:59476] PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: A
n exception occured in driver: could not find driver in /var/www/html/nextcloud/lib/private/DB/Connection.php:61\nStack trace:\n#0 /var/www/html/nextcloud/3rdparty/doctrine/db
al/lib/Doctrine/DBAL/Connection.php(992): OC\DB\Connection->connect()\n#1 /var/www/html/nextcloud/lib/private/DB/Connection.php(213): Doctrine\DBAL\Connection->executeUpda
te(‘PRAGMA read_unc…’, Array, Array)\n#2 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): OC\DB\Connection->executeUpdate(‘PRAGMA read
_unc…’)\n#3 /var/www/html/nextcloud/lib/private/DB/Connection.php(148): Doctrine\DBAL\Connection->setTransactionIsolation(2)\n#4 /var/www/html/nextcloud/3rdparty/doctrine/
dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOSqlite\Driver), Object(Doctrine\DBAL\Configuration),
Object(Doctrine\Common\EventManager))\n#5 /var/www/html/nextcloud/lib/private/DB/ConnectionFactor in /var/www/html/nextcloud/lib/private/DB/Connection.php on line 61
[Tue Nov 07 18:46:53.483354 2017] [:error] [pid 782] [client 192.168.1.64:59476] PHP Fatal error: Uncaught Doctrine\DBAL\DBALException: Failed to connect to the database: A
n exception occured in driver: could not find driver in /var/www/html/nextcloud/lib/private/DB/Connection.php:61\nStack trace:\n#0 /var/www/html/nextcloud/3rdparty/doctrine/db
al/lib/Doctrine/DBAL/Connection.php(992): OC\DB\Connection->connect()\n#1 /var/www/html/nextcloud/lib/private/DB/Connection.php(213): Doctrine\DBAL\Connection->executeUpda
te(‘PRAGMA read_unc…’, Array, Array)\n#2 /var/www/html/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(623): OC\DB\Connection->executeUpdate(‘PRAGMA read
_unc…’)\n#3 /var/www/html/nextcloud/lib/private/DB/Connection.php(148): Doctrine\DBAL\Connection->setTransactionIsolation(2)\n#4 /var/www/html/nextcloud/3rdparty/doctrine/
dbal/lib/Doctrine/DBAL/DriverManager.php(172): OC\DB\Connection->__construct(Array, Object(Doctrine\DBAL\Driver\PDOSqlite\Driver), Object(Doctrine\DBAL\Configuration),
Object(Doctrine\Common\EventManager))\n#5 /var/www/html/nextcloud/lib/private/DB/ConnectionFactor in /var/www/html/nextcloud/lib/private/DB/Connection.php on line 61

Bought a new SD card.
Managed to get Nexcloudpi to work.