I tested on Ubuntu 12.10 64bit server edition, it should work well in other versions
1) Install Redis server
Earlier today I was looking for an alternative repository for Redis and luckily I ran into Dotdeb. They have a bunch of nice packages, always up to date with the very latest version.
In order to get in on this goodness you must first add the Dotdeb repositories to your APT sources. Create a new list file in /etc/apt/sources.list.d/ and fill it with the following content.
Create new file:
Then add these lines to this file
$ vi /etc/apt/sources.list.d/dotdeb.org.list
Then you need to authenticate these repositories using their public key.
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all
And finally, update your APT cache and install Redis.
wget -q -O - http://www.dotdeb.org/dotdeb.gpg | sudo apt-key add -
You got Redis server working with these credentials:
$ sudo aptitude update
$ sudo aptitude install redis-server
2) Preparation for install PHP Redis extension
php5-dev provides the dev library as well as the phpize command which is required for the compiling step
$ sudo apt-get install php5-dev
3) Get phpredis source code, should be pretty easy by running
Get phpredis source
$ sudo apt-get install git
4) Compile and install
$ git clone git://github.com/nicolasff/phpredis.git
5) Enable the phpredis extension
sudo -s make install
6) Restart server
To make sure everything is working well, you have to restart server/vps.
7) Write a simple php script to test (running on cli would be fine if php5-cli is installed)
And now run this script, if it display blank page then you get success or just tell me
$redis=new Redis() or die("Can not load redis.");
View more threads in the same category: