Plugin Support
qtwrk
(@qtwrk)
Hi,
Does your provider provide you Redis ?
if you create a php file with code
<?php
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$res = $redis->ping();
echo $res;
access it by browser, what does it say ?
best regards,
Thread Starter
benz1
(@benz1)
According to the host they do (although I don’t know if I need to do anything to activate it on the account) but when I run this file I get,
Fatal error: Uncaught RedisException: Connection refused in /home/xxxx/public_html/redis.php:3 Stack trace: #0 /home/xxxx/public_html/redis.php(3): Redis->connect('127.0.0.1', 6379) #1 {main} thrown in /home/xxxx/public_html/redis.php on line 3
Thanks
Plugin Support
qtwrk
(@qtwrk)
Hi,
yeah , that indicates the Redis is not running or not accepting connection with the simple test script
you will need your provider’s to solve it first , make sure that simple test script works , where it should gives “1” return
after that if the test script works and plugin doesn’t work , that’s the time we need to investigate
Best regards,
Hi, I just had the same problem and between the host EAPPS using Jelaastic and me, it was solved, but actually in this case I think it was a Jelastic problem (neither Litespeed or host) which made it more complicated and the fix won’t apply to others.
Sorry for long intro – here is the problem:
- The file
/etc/systemd/system/redis.service.d/override.conf was set to –daemonize no which overrode the /etc/redis.conf file and was inaccessible to the user
- And in the
redis.conf file the port was not set to 6379
So in effect there was no way to get it to work as the plugin config wanted it to work out of the box. Also it would help if the plugin defaulted to 127.0.0.1 since that’s what the redis.conf file wants.
Cheers
Mike
PS the installation for the litespeed server came from here: Jelastic Litespeed Github Installer
-
This reply was modified 4 years, 3 months ago by
5doc.
Thread Starter
benz1
(@benz1)
@qtwrk in my case, I went back to the host and they replied, “Redis was installed on the server, but it was not added to the cageFS for your account. I have added it to your cageFS and it should be able to be accessed now”. The above script is now returning the “1” (although the Redis test file at https://docs.litespeedtech.com/lscache/lscwp/admin/#how-to-debug is still failing) but the Object cache page is still showing the connection test as Failed. I’ve checked the page on several other sites on the same server and it’s showing the Connection test as ‘unavailable’.
Any suggestions?
Thanks.
Please see #1 of my post above. Check this file if you can.
Thread Starter
benz1
(@benz1)
Thanks @5doc but I don’t have root access so cannot check this file.
Not even to read it?
Ask your host.
If it is set to daemonize NO you might be able to override without root access via the CLI and Redis will work until there is a reboot.
redis-server --daemonize yes
Plugin Support
qtwrk
(@qtwrk)
daemonized or not , does not really matter , as long as there is a redis process running and accept connection
what was host/port setting your provider used in test script makes it return 1 ? apply same host/port to plugin’s setting ought do it
-
This reply was modified 4 years, 3 months ago by
qtwrk.
Thread Starter
benz1
(@benz1)
Thanks @qtwrk it was port 6379 as per the script you provided above. I checked the cache page and even though I had Redis selected it was showing the Memcached port of 11211 so I changed it to 6379, saved the changes and the connection test has now passed. So I’ve re-enable Object Cache and will see how I get on. Thanks for your help.