Setup:
New Nextcloud 27.0.2 install on Archlinux: 6.4.12-arch1-1 Apache/2.4.57
(Unix) OpenSSL/3.1.2 mod_fcgid/2.3.9 PHP/8.1.23
This is a single server, home install in effort to migrate from eGroupware. The install is in the /nextcloud directory off the document root.
The issue you are facing:
- APCu cache causes internal server error;
- .well-known/xxx warnings do not resolve with recommendations from Nextcloud - Service Discovery.
The server works fine (but slow) without the cache and the warnings on Admin-Overview are informational, but the cache is greatly needed as Nextcloud will bring this small server to its knees.
APCu cache issue, the module is installed and the extension is enable
- in
config.php
I added'memcache.local' => '\OC\Memcache\APCu',
- in
/etc/php-legacy/php-fpm.d/nextcloud.conf
I enabled
php_value[extension] = apcu
php_admin_value[apc.ttl] = 7200
- in
/etc/webapps/nextcloud/php.ini
I enabled:
; APCu cache for nextcloud
;
extension=apcu
apc.ttl=7200
apc.enable_cli = 1
Upon reloading the server with the cache enabled, nextcloud crashes:
The server encountered an internal error and was unable to complete your request.
Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.
More details can be found in the server log.
The nextcloud log doesn’t contain anything informative:
{"reqId":"TuFO7ny6RratByEvEg14","level":3,"time":"2023-09-07T03:18:48+00:00","remoteAddr":"XXX.XXX.X.XXX","user":"david","app":"PHP","method":"REPORT","url":"/nextcloud/remote.php/dav/calendars/david/tasks/","message":"Module \"bcmath\" is already loaded at Unknown#0","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0","version":"27.0.2.1","data":{"app":"PHP"}}
But the Apache log is hepful
[proxy_fcgi:error] [pid 152023] [client XXX.XXX.X.XXX:54312] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught OCP\\HintException: [0]: Memcache \\OC\\Memcache\\APCu not available for local cache (Is the matching PHP module installed and enabled?)\n\n thrown in /usr/share/webapps/nextcloud/lib/private/Memcache/Factory.php on line 90'
Though it doesn’t really say much more than it can’t find the module and doesn’t think it’s working. I’ve followed the manual and the Archlinux wiki - Nextcloud but as soon as the cache is enable, nextcloud goes tits-up. (all other PHP apps continue working fine)
2 .well-known not configured
Per the nextcloud docs, with my install in /nextcloud, I should edit/create the .htaccess
file in the document root and include:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^\.well-known/carddav /nextcloud/remote.php/dav [R=301,L]
RewriteRule ^\.well-known/caldav /nextcloud/remote.php/dav [R=301,L]
RewriteRule ^\.well-known/webfinger /nextcloud/index.php/.well-known/webfinger [R=301,L]
RewriteRule ^\.well-known/nodeinfo /nextcloud/index.php/.well-known/nodeinfo [R=301,L]
</IfModule>
I do, and nothing changes. When I access the Admin Overview, the same errors are shown (showing full warnings as they relate to both issues, the cache and the .well-known/xxx entries):
Your web server is not properly set up to resolve "/.well-known/webfinger". Further information can be found in the documentation ↗.
Your web server is not properly set up to resolve "/.well-known/nodeinfo". Further information can be found in the documentation ↗.
Your web server is not properly set up to resolve "/.well-known/caldav". Further information can be found in the documentation ↗.
Your web server is not properly set up to resolve "/.well-known/carddav". Further information can be found in the documentation ↗.
The database is used for transactional file locking. To enhance performance, please configure memcache, if available. See the documentation ↗ for more information.
No memory cache has been configured. To enhance performance, please configure a memcache, if available. Further information can be found in the documentation ↗.
The PHP OPcache module is not properly configured. See the documentation ↗ for more information.
The OPcache interned strings buffer is nearly full. To assure that repeating strings can be effectively cached, it is recommended to apply opcache.interned_strings_buffer to your PHP configuration with a value higher than 8.
My current config is:
<?php
$CONFIG = array (
'datadirectory' => '/var/lib/nextcloud/data',
'logfile' => '/var/log/nextcloud/nextcloud.log',
'default_locale' => 'en_US',
'default_phone_region' => 'US',
'knowledgebaseenabled' => true,
'apps_paths' =>
array (
0 =>
array (
'path' => '/usr/share/webapps/nextcloud/apps',
'url' => '/apps',
'writable' => false,
),
1 =>
array (
'path' => '/var/lib/nextcloud/apps',
'url' => '/wapps',
'writable' => true,
),
),
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'my.site.com',
2 => 'XXX.XXX.X.XXX',
),
'overwrite.cli.url' => 'https://my.site.com/nextcloud',
'htaccess.RewriteBase' => '/nextcloud',
<credentials snipped>
'dbtype' => 'mysql',
'version' => '27.0.2.1',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:/run/mysqld/mysqld.sock',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'nextcloud',
<snipped password and mail>
'maintenance' => false,
/* 'memcache.local' => '\\OC\\Memcache\\APCu', */
/* 'memcache.local' => '\OC\Memcache\Redis',
'memcache.distributed' => '\OC\Memcache\Redis',
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => [
'host' => '/run/redis/redis.sock',
'port' => 0,
'dbindex' => 0,
'password' => '',
'timeout' => 1.5,
], */
);
The cache config for both APCu and Redis are commented out to restore nextcloud operation.
I’ve pulled my hair out over these two issue and just need a bit of help.
Where am I going wrong?