Blank page after adding memcache in config.php

Hello,

I’m having problem when I try to add memcache to my Nextcloud.

This is the configuration of my server:

  • OS: CentOS 7
  • PHP release: 7.0 (from epel repository)
  • Nextcloud release: 12.0.5

I installed the package php70w-pecl-apcu and I added into my config/config.php file this line:

‘memcache.local’ => ‘\OC\Memcache\APCu’,

Right after I save/quit this file I can’t access to any page on my Nextcloud, they are all blank (and without HTML code inside). This is my actual PHP7 configuration from infophp():

APCu Support Enabled
Version 5.1.8
APCu Debugging Disabled
MMAP Support Disabled
Serialization Support php
Build Date Sep 16 2017 17:52:52
Directive Local Value Master Value
apc.coredump_unmap Off Off
apc.enable_cli Off Off
apc.enabled On On
apc.entries_hint 4096 4096
apc.gc_ttl 3600 3600
apc.preload_path no value no value
apc.serializer default default
apc.shm_segments 1 1
apc.shm_size 64M 64M
apc.slam_defense On On
apc.smart 0 0
apc.ttl 7200 7200
apc.use_request_time On On
apc.writable /tmp /tmp

Additional .ini files parsed /etc/php.d/apcu.ini, /etc/php.d/bz2.ini, /etc/php.d/calendar.ini, /etc/php.d/ctype.ini, /etc/php.d/curl.ini, /etc/php.d/dom.ini, /etc/php.d/exif.ini, /etc/php.d/fileinfo.ini, /etc/php.d/ftp.ini, /etc/php.d/gd.ini, /etc/php.d/gettext.ini, /etc/php.d/gmp.ini, /etc/php.d/iconv.ini, /etc/php.d/json.ini, /etc/php.d/mbstring.ini, /etc/php.d/mcrypt.ini, /etc/php.d/mysqlnd.ini, /etc/php.d/mysqlnd_mysqli.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysqlnd.ini, /etc/php.d/pdo_sqlite.ini, /etc/php.d/phar.ini, /etc/php.d/posix.ini, /etc/php.d/shmop.ini, /etc/php.d/simplexml.ini, /etc/php.d/sockets.ini, /etc/php.d/sqlite3.ini, /etc/php.d/sysvmsg.ini, /etc/php.d/sysvsem.ini, /etc/php.d/sysvshm.ini, /etc/php.d/tokenizer.ini, /etc/php.d/xml.ini, /etc/php.d/xml_wddx.ini, /etc/php.d/xmlreader.ini, /etc/php.d/xmlwriter.ini, /etc/php.d/xsl.ini, /etc/php.d/zip.ini

Have you an idea to solve that ?

Regards,
koshie

A blank page is usually a php fatal error. Did check for that in all logfiles? Is memcached running?

I don’t have anything related to today in my php-fpm error log file.

This is all the error I got in httpd error log file for this domain:

[Mon Jan 29 12:36:33.488382 2018] [authz_core:error] [pid 24104] [client 158.58.176.199:53298] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jan 29 12:43:19.450215 2018] [:error] [pid 28809] [client 158.58.176.199:47328] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 2224793059360 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:43:21.087876 2018] [:error] [pid 28813] [client 158.58.176.199:42308] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 140406239525200 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:43:21.820297 2018] [authz_core:error] [pid 28820] [client 158.58.176.199:59074] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jan 29 12:46:19.280378 2018] [:error] [pid 28964] [client 158.58.176.199:54559] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901907870176 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:46:20.842644 2018] [:error] [pid 28957] [client 158.58.176.199:60126] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922257232 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:46:21.698325 2018] [authz_core:error] [pid 28971] [client 158.58.176.199:40543] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jan 29 12:48:38.892210 2018] [:error] [pid 28960] [client 158.58.176.199:36180] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922213920 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:48:42.445184 2018] [:error] [pid 28964] [client 158.58.176.199:50278] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922213920 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:48:44.630620 2018] [:error] [pid 28971] [client 158.58.176.199:53661] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922426656 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:48:45.910993 2018] [:error] [pid 28975] [client 158.58.176.199:63676] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139899969732648 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:48:50.961594 2018] [:error] [pid 28976] [client 158.58.176.199:48966] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 576744426303389728 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:48:57.250004 2018] [:error] [pid 28957] [client 158.58.176.199:36821] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901570272296 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:50:25.192934 2018] [:error] [pid 28959] [client 89.92.217.148:52720] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139899969732664 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:50:27.735563 2018] [:error] [pid 28960] [client 89.92.217.148:52724] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901908115616 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:51:01.641504 2018] [:error] [pid 28957] [client 89.92.217.148:52736] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 17179869504 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:51:02.098743 2018] [:error] [pid 28961] [client 89.92.217.148:52748] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901908115616 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:51:10.931873 2018] [:error] [pid 28964] [client 89.92.217.148:52752] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922257232 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:52:13.836810 2018] [:error] [pid 28964] [client 158.58.176.199:59746] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922257232 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:54:20.455581 2018] [:error] [pid 28964] [client 158.58.176.199:41040] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922257232 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:54:21.691482 2018] [:error] [pid 28976] [client 158.58.176.199:56524] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901569976936 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:54:22.379320 2018] [:error] [pid 29071] [client 158.58.176.199:49586] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901557570992 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:54:22.797421 2018] [:error] [pid 28957] [client 158.58.176.199:36843] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 25769803808 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:54:22.978206 2018] [:error] [pid 29074] [client 158.58.176.199:46257] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 4294967328 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:54:23.154747 2018] [:error] [pid 28961] [client 158.58.176.199:56575] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 4294967328 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:54:26.244696 2018] [:error] [pid 28975] [client 158.58.176.199:53787] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139899969732664 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:34.747189 2018] [:error] [pid 28976] [client 158.58.176.199:48619] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922284288 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:36.157180 2018] [:error] [pid 28957] [client 158.58.176.199:55643] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901571023160 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:36.859509 2018] [:error] [pid 29074] [client 158.58.176.199:35121] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901571023160 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:37.037482 2018] [:error] [pid 28961] [client 158.58.176.199:54111] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139899969732664 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:37.205203 2018] [:error] [pid 29258] [client 158.58.176.199:51047] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 12884901920 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:37.370619 2018] [:error] [pid 28964] [client 158.58.176.199:49798] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 4294967328 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:37.496550 2018] [:error] [pid 28977] [client 158.58.176.199:51351] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 4294967328 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:37.675980 2018] [:error] [pid 28976] [client 158.58.176.199:41215] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901559668144 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:37.804806 2018] [:error] [pid 28957] [client 158.58.176.199:38955] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139899969732664 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:38.021796 2018] [:error] [pid 29074] [client 158.58.176.199:44447] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139899969732664 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:55:38.192892 2018] [:error] [pid 28961] [client 158.58.176.199:62927] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922257232 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:57:40.198333 2018] [authz_core:error] [pid 28964] [client 158.58.176.199:43105] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jan 29 12:57:59.483639 2018] [authz_core:error] [pid 29391] [client 158.58.176.199:62361] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jan 29 12:58:41.338107 2018] [:error] [pid 29336] [client 158.58.176.199:34596] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922426656 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:58:42.603558 2018] [:error] [pid 29391] [client 158.58.176.199:53857] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922162240 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:58:43.206372 2018] [authz_core:error] [pid 28975] [client 158.58.176.199:36538] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jan 29 12:58:45.186810 2018] [:error] [pid 29336] [client 158.58.176.199:42610] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 94664528492464 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:58:47.528825 2018] [:error] [pid 29391] [client 158.58.176.199:43315] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 139901922186960 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 12:59:08.969321 2018] [authz_core:error] [pid 29329] [client 158.58.176.199:57150] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata
[Mon Jan 29 13:01:27.391162 2018] [proxy_fcgi:error] [pid 29521] [client 158.58.176.199:39983] AH01071: Got error 'Primary script unknown\n'
[Mon Jan 29 14:08:52.450088 2018] [:error] [pid 29516] [client 158.58.176.199:34179] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 2224793059360 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 14:08:57.504075 2018] [:error] [pid 29521] [client 158.58.176.199:60074] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 81604378656 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 14:09:00.863319 2018] [:error] [pid 28964] [client 158.58.176.199:33092] PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 2224793059360 bytes) in /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php on line 272
[Mon Jan 29 14:09:25.162071 2018] [proxy_fcgi:error] [pid 29521] [client 158.58.176.199:36312] AH01071: Got error 'Primary script unknown\n', referer: https://nextcloud.koshie.fr/core/doc/user/index.html
[Mon Jan 29 14:09:31.748443 2018] [authz_core:error] [pid 29516] [client 158.58.176.199:52485] AH01630: client denied by server configuration: /var/www/html/nextcloud/data/.ocdata

For now memcached isn’t enabled in config.php because I can’t use Nextcloud if I do. Do you need more ?

Change
‘memcache.local’ => ‘\OC\Memcache\APCu’,
to:
‘memcache.local’ => ‘\\OC\\Memcache\\APCu’,

(note the double backslashes)

Also make sure you have added something like the following to your php.ini (configurable, depends on the server hardware):

extension=apcu.so
apc.enabled=1

apc.shm_size=1024M
apc.max_file_size=10M
apc.num_files_hint=20000
apc.user_entries_hint=20000

apc.ttl=7200
apc.enable_cli=1
apc.gc_ttl=3600
apc.entries_hint=4096
apc.slam_defense=1
apc.serializer=igbinary

Thanks for the tips, but everytime I try a new request on my Nextcloud after adding your line I got in my httpd error log file this:

[Mon Jan 29 15:25:34.991355 2018] [:error] [pid 29516] [client 158.58.176.199:56834] PHP Fatal error: Uncaught Error: Call to a member function getRequest() on null in /var/www/html/nextcloud/remote.php:47\nStack trace:\n#0 /var/www/html/nextcloud/remote.php(167): handleException(Object(ParseError))\n#1 {main}\n thrown in /var/www/html/nextcloud/remote.php on line 47

Plus with your addition in my php.ini it doesn’t works better, still a blank page.

Here is the error:

PHP Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 94664528492464 bytes)

You have reloaded/restarted the webserver after you did add those lines to the php.ini, have you?

the extension/file apcu.so is in your path, is it?

Also some settings are depending on your server hardware (amount of RAM etc.). Don’t just blindly copy/paste.

Yeah I restarted the httpd and php-fpm service right after that.

About the file apcu.so in my path I don’t know how to check that, I guess it’s in a PHP path ? I have this file : /etc/php.d/apcu.ini (saw that in my phpinfo() web page).

The settings you give me is under my amount of RAM, which is 8Gb, do I need to put more than 1Gb for apc.shm_size ?

My advice would be to set apc.shm_size to 128 Mb for start then scale up as needed.

As you recommended I changed the value to 128Mb for a first start.

Still having my problem though. And I’m out of ideas, maybe I should try to remove the acpu package and everything related to this and try again.

It’s not something vital for my Nextcloud, I have only 3 users and I don’t think I really need this optimization but still it looked nice.