Integrating Redis with Php

Predis is a flexible and feature-complete Redis client library for PHP.

  • Download the Predis Package and extract it.
  • Place it in the folder of your site.
  • Use the following in the php files to load the package and to use Redis,

require ‘predis/Autoload.php’;

  • Now you can connect to the Redis Server and can use it.

$client = new Predis\Client();


$client->set(‘foo’, ‘bar’);
$value = $client->get(‘foo’);

Possible Error: Require Failed to open Stream. Permission Denied in…

Solution: Change the folder permission for Predis to 755


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s