After installing redis, error page

my nextcloud installed in centos version 7, after installing of redis im getting error blank page when i access our nextcloud thru firefox.

i just added this in my config file

‘memcache.local’ => ‘\OC\Memcache\Redis’,
‘redis’ => array(
‘host’ => ‘localhost’,
‘port’ => 6379,
),

thanks

First, look at your webserver logs. A blank page will normally log an error.

Second, set up Redis to use a socket instead:

ok i checked the log file and i found this error message
[Sun Oct 01 08:00:30.302505 2017] [:error] [pid 11902] [client 10.8.15.191:50208] PHP Parse error: syntax error, unexpected end of file, expecting ‘)’ in /var/www/html/nextcloud/config/config.php on line 41
[Sun Oct 01 08:00:31.350652 2017] [:error] [pid 11897] [client 192.168.50.208:41046] PHP Parse error: syntax error, unexpected end of file, expecting ‘)’ in /var/www/html/nextcloud/config/config.php on line 41

I just added this first
’memcache.local’ => ‘\OC\Memcache\APCu’,
‘memcache.locking’ => ‘\OC\Memcache\Redis’,
‘filelocking.enabled’ => ‘true’,
‘redis’ =>
array (
‘host’ => ‘/var/run/redis/redis.sock’,
‘port’ => 0,
‘timeout’ => 0.0,
),

what is the correct syntax?

You’re missing one further ), in the file, but you’d have to post your full config with passwords x’d out to confirm.

Hi
after changing syntax like ’ to ‘ then i restarted http service i can able to view our nextcloud but when i checked the log file i found this.
[Sun Oct 01 16:27:29.577687 2017] [:error] [pid 16335] [client 192.168.50.208:54422] PHP Notice: Use of undefined constant \xe2\x80\x98host\xe2\x80\x99 - assumed ‘\xe2\x80\x98host\xe2\x80\x99’ in /var/www/html/nextcloud/config/config.php on line 40

the line 40 is
‘host’ => ‘/var/run/redis/redis.sock’,

Cool so it was the wrong apostrophe mark (I don’t know the exact names for the different ones).

In any case it’s still wrong, you need to use this one:

 'instanceid' => 'peanuts',

Copy and paste them from the example above.

But in your posted config file, the ' actually looks correct.

The error might be also related to missing /var/run/redis/redis.sock or missing permissions for www-data user.

Did you follow all steps of Jasons guide https://bayton.org/docs/nextcloud/installing-nextcloud-on-ubuntu-16-04-lts-with-redis-apcu-ssl-apache/#6-2-enable-caching, expecially changing redis socket file permissions and adding www-data to redis group?

ls -al /var/run/redis/ output in case.

there is no redis path directory
[root@stp1200 config]# ls -al /var/run/redis/
total 0
drwxr-xr-x 2 redis redis 40 Oct 1 07:51 .
drwxr-xr-x 39 root root 1080 Oct 2 02:35 …
You have new mail in /var/spool/mail/root
[root@stp1200 config]#

but i have /etc/redis.conf

thanks

[root@stp1200 redis]# pwd
/var/run/redis
[root@stp1200 redis]# ls
[root@stp1200 redis]#
[root@stp1200 redis]# whereis redis.sock
redis: /etc/redis.conf
[root@stp1200 redis]#

under redis.conf

unixsocket /tmp/redis.sock
unixsocketperm 770
#port 6379
port 0

Ah so there it is, if redis-server starts up successfully (service redis-server status). This is just an unusul path to me, but then you have to change the host line in your config.php to 'host' => '/tmp/redis.sock' or change redis.conf to create the socket in /var/run/redis/redis.sock.

here is my redis status

[root@stp1200 etc]# service redis status
Redirecting to /bin/systemctl status redis.service
● redis.service - Redis persistent key-value database
Loaded: loaded (/usr/lib/systemd/system/redis.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/redis.service.d
└─limit.conf
Active: active (running) since Mon 2017-10-02 14:37:48 PHT; 1min 0s ago
Process: 32061 ExecStop=/usr/libexec/redis-shutdown (code=exited, status=0/SUCCESS)
Main PID: 32098 (redis-server)
CGroup: /system.slice/redis.service
└─32098 /usr/bin/redis-server 127.0.0.1:0

Oct 02 14:37:48 stp1200.network.com systemd[1]: Started Redis persistent key…
Oct 02 14:37:48 stp1200.network.com systemd[1]: Starting Redis persistent ke…
Hint: Some lines were ellipsized, use -l to show in full.

i replaced it line 40 ‘/tmp/redis.sock’ but still no luck i restarted the httpd and redis
[Mon Oct 02 14:40:51.701762 2017] [:error] [pid 1077] [client 192.168.50.165:55861] PHP Notice: Use of undefined constant \xe2\x80\x98host\xe2\x80\x99 - assumed ‘\xe2\x80\x98host\xe2\x80\x99’ in /var/www/html/nextcloud/config/config.php on line 40

Hmm okay, after reviewing your error message (and google it: link) I think Jasons idea was right and there is still something wrong about the apostrophe. Nevertheless let config.php pointing to the right redis.sock position is of course necessary, too.

  'redis' =>
  array (
    'host' => '/tmp/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
  ),

Could you try to copy/paste this block again?

1 Like

ok i changed it

but there is new error message line 36
[Mon Oct 02 15:22:05.704018 2017] [:error] [pid 32466] [client 192.168.50.254:23977] PHP Parse error: syntax error, unexpected ‘\’ (T_NS_SEPARATOR), expecting ‘)’ in /var/www/html/nextcloud/config/config.php on line 36

here is the line 36
'memcache.locking => ‘\OC\Memcache\Redis’,

and here is the full
line36

full

There is one apostrophe missing behind “…locking”, copy/paste:

'memcache.locking' => '\\OC\\Memcache\\Redis',
1 Like

still error
[Mon Oct 02 15:34:27.121468 2017] [:error] [pid 3379] [client 192.168.50.173:57561] PHP Parse error: syntax error, unexpected ‘\’ (T_NS_SEPARATOR), expecting ‘)’ in /var/www/html/nextcloud/config/config.php on line 36