Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Class 'redis' Not Found Rate Topic   - - - - -

 
  • AlexZ
  • Newbie
  • Trial users
  • Join Date: 28-Jun 17
  • 7 posts

Posted 19 July 2017 - 08:36 AM #1

Hello.

 

We trying use Redis for session backend. When in config.local.php I set $config['session_backend'] = 'redis'; then I have error: Class 'Redis' not found at store\app\Tygh\Backend\Session\Redis.php, line: 200

 

Please help.

 

Regards,

Alex.



 
  • CS-Cart team
  • CS-Cart support team
  • Moderators
  • Join Date: 04-Apr 11
  • 3809 posts

Posted 19 July 2017 - 01:10 PM #2

Hello.

 

We trying use Redis for session backend. When in config.local.php I set $config['session_backend'] = 'redis'; then I have error: Class 'Redis' not found at store\app\Tygh\Backend\Session\Redis.php, line: 200

 

Please help.

 

Regards,

Alex.

 

It looks like Redis is not installed on your server


Sincerely yours, CS-Cart Support Team

 

User guide       |  Developer documentation  |  Core API documentation


 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 275 posts

Posted 19 July 2017 - 08:06 PM #3

If you are using Ubuntu, you can run:

 

sudo apt-get install redis-server -y
 
You need to install redis support from PHP.
 
pecl install redis
 
and add redis.so into your php configuration.


 
  • AlexZ
  • Newbie
  • Trial users
  • Join Date: 28-Jun 17
  • 7 posts

Posted 20 July 2017 - 09:32 AM #4

 

If you are using Ubuntu, you can run:

 

sudo apt-get install redis-server -y
 
You need to install redis support from PHP.
 
pecl install redis
 
and add redis.so into your php configuration.

 

Thanks all for help! Yes, OS is Ubuntu. But we use AWS and session_redis_server is not localhost, I set it to another host that AWS provided (.....usw2.cache.amazonaws.com). Port is default for redis 6379. Or we can use Redis only on the same server? 



 
  • mazter
  • Senior Member
  • Members
  • Join Date: 04-Apr 12
  • 275 posts

Posted 20 July 2017 - 02:46 PM #5

You have the option to assign a redis server. You could point to your other redis server. I would put IP address instead of domain name.

 

$config['cache_redis_server'] = 'localhost';
$config['cache_redis_global_ttl'] = 0; // set this if your cache size reaches Redis server memory size
 
// Storage backend for sessions. Available backends: database, redis
$config['session_backend'] = 'redis';
$config['session_redis_server'] = 'localhost'


 
  • AlexZ
  • Newbie
  • Trial users
  • Join Date: 28-Jun 17
  • 7 posts

Posted 20 July 2017 - 06:33 PM #6

Ok, but I still not understand why error here (line 200, and error that class not found but not that can't connect to Redis)???

So in __construct in line 50 we call connect method line 59.

Ashampoo_Snap_2017.07.20_20h27m03s_001_.jpg

And then in the connect method I have this error on line 200.

Ashampoo_Snap_2017.07.20_20h27m25s_002_.jpg

 



 
  • dhaupin
  • Member
  • Members
  • Join Date: 07-Apr 16
  • 19 posts

Posted 09 August 2017 - 10:56 PM #7

First, if you are using another server, make sure redis port is open in your firewall and that its limited to whatever server is using it.

 

From the CLI, run "redis-cli" and type "ping". You should see a pong back. Later you can use redis-cli with "monitor" to see all is working.

 

From CLI run your PHP with the -m option. It will tell you if redis is loaded at master. "php -m" will use whatever install is default. If you use a custom path, like 7.0 or something, type out the whole bin "/path/to/php -m".

 

If there is no redis.so, do a system search for "redis.so". Sometimes it gets installed outside of a PHP install being used.If its not there, install it from PECL or whatever other method. If it is there, you can symlink it to the modules directory of whatever custom PHP path you use, and match the permissions to other modules there.

 

Finally, ensure any applicable app is able to use it. You made have to enable/write in an extension=redis.so in your preferred php.ini (or redis.ini include). You can include it twice, but it will fill logs with extension already loaded errors.

 

Good luck :)


https://creadev.org | support@creadev.org - CS-Cart Addons, Integrations, & Development. Made in the USA.


 
  • AlexZ
  • Newbie
  • Trial users
  • Join Date: 28-Jun 17
  • 7 posts

Posted 16 March 2018 - 02:31 PM #8

Thanks for so very detailed answer, it's helped!!! The issue was because in PHP not installed Redis extension.

 

First, if you are using another server, make sure redis port is open in your firewall and that its limited to whatever server is using it.

 

....