Nextcloud on Synology NAS

My four years old Synology DS216 couldn’t run Nextcloud, but the new DS720+ can, and happily so.

The basics are straightforward. Download the ZIP file from nextcloud.org, unzip it under the web shared folder, and configure it in the Web Station app, and run the Nextcloud installer.

I only had two problems.

Memcache

Nextcloud prefers having a memory cache configured, and apparently the apcu module isn’t available in the Synology PHP package. It is not in the list of modules in the Web Station interface.

It is there, though.

To activate it, create the file /usr/local/etc/php74/cli/conf.d/nextcloud.ini with this content:

extension = apcu.so

[apc]
apc.shm_size = 512M
apc.enable_cli = 1

and then enable the memcache normally in the Nextcloud config.php.

That’ll make the warning go away.

Cron-jobs

I kept getting complaints about Nextcloud cron jobs non being run, and I fixed that my creating a normal system crontab for Nextcloud.

Create the file /etc/cron.d/nextcloud with content:

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin

0,10,20,30,40,50 * * * * http php74 /volume1/web/nextcloud/cron.php

Adjust the path to you nextcloud installation directory.

The cron daemon should pick up the new file automatically. If it doesn’t reload the cron daemon with systemctl reload crond.

You could probably do the same just as easily using the DSM Task Scheduler.


Comments

2 responses to “Nextcloud on Synology NAS”

  1. Dear René, I got the cron job running using the Task Scheduler with this command:
    sudo -u http php74 -f /volume1/web/nextcloud/cron.php
    Unfortunately, when I add
    ‘memcache.local’ => ‘\\OC\\Memcache\\APCu‘,
    to the config.php (for getting rid of the Cache warning in admin web portal of Nextcloud) the command above does not work anymore with error message:
    OCP\HintException: [0]: Memcache \OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)
    Do you know how I can make Cron job and PHP memory cache work together? I suspect a small thing – but I cannot figure it out. I’m running Nextcloud 24.0.1, PHP 7.4, DSM 7.1
    It would be great if you had any hint or idea. Best regards.

    1. René Seindal avatar
      René Seindal

      The PHP running under apache and the CLI PHP are most probably reading different INI files, so the APCu module is loaded under the web server, but not in the CLI version. You need to chase down the INI files.

Leave a Reply

Your email address will not be published. Required fields are marked *