Hello Everyone,
In this tutorial,
Let Us Install and Use Redis & Redis-Server 3.0.2 on Ubuntu 15.04 – 64Bit
You can also install in Debain 8, Linux Mint 17.
Download Redis
http://redis.io/download
Redis Installation by “apt” Repository -
Write the following code in it.
Step1 :- sudo nano /etc/apt/sources.list
deb http://packages.dotdeb.org squeeze all
deb-src http://packages.dotdeb.org squeeze all
Step2 :- wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | sudo apt-key add -
Step3 :- sudo add-apt-repository ppa:chris-lea/redis-server
Step4 :- sudo apt-get update
Step5 :- sudo apt-get install redis-server
Redis Installation using Source
Download, extract and compile Redis with:
Step6 :- wget http://download.redis.io/redis-stable.tar.gz
Or wget http://download.redis.io/releases/redis-3.0.2.tar.gz
Step7 :- tar xzf redis-3.0.2.tar.gz Or tar xvzf redis-stable.tar.gz
Step8 :- cd redis-3.0.2 Or cd redis-stable
Step9 :- make
Step9 :- sudo apt-get install tcl8.5
Step10 :- make test
Step11 :- sudo make install
To access the script move into the utils directory
Step12 :- cd utils
Install script
Step13 :- sudo ./install_server.sh
You can start and stop redis with these commands
Step14 :- sudo service redis_6379 start
sudo service redis_6379 stop
The binaries that are now compiled are available in the src directory:
Step15 :- src/redis-server
Check if Redis is working
Step16 :- redis-cli Or redis-cli ping Or src/redis-cli
Step17 :- set foo bar
Step18 :- get foo
Output :- redis 127.0.0.1:6379>
To set Redis to automatically start at boot, run
Step19 :- sudo update-rc.d redis_6379 defaults
Install Redis as PHP Extension
You can start and stop redis with these commands
Step20 :- sudo apt-get -y install php5-redis
Install Redis extension of PHP using Source
Step21 :- sudo apt-get -y install php5-dev
Download phpredis from git repository
Step22 :- sudo apt-get -y install git
Step23 :- git clone git://github.com/nicolasff/phpredis.git
Compile and install phpRedis by running
Step24 :- cd phpredis
Step25 :- phpize
Step26 :- ./configure
Step27 :- make
Step28 :- sudo -s make install
Next we need to add extension with php configuration so that php can enable this
Step29 :- sudo -s
Step30 :- echo "extension=redis.so">/etc/php5/conf.d/redis.ini
To check Redis is working with php
Step31 :- vi phpredis.php
Write the following code in the phpredis.php
<?php
redis=new Redis() or die("Can not load Redis.");
$redis->connect('127.0.0.1');
$redis->set('Redis test_key', 1);
Run the phpredis.php file either using your browser or command line
Step32 :- php phpredis.php
Removing Redis 3.0.2
Step33 :- sudo apt-get remove redis-server
Or
Step34 :- sudo apt-get purge--auto-remove redis-server
-------------------------------------------------------------------------------
For Your Information Only
I am Willing to Make a FREE or CHARGE Website, if YOU WANT ME TO MAKE A VIDEOS ON Different Technologies I WILL DO IT..
Share My Video, Like it, Watch Others Videos and Have any Quries Email me (itcloudnet@gmail.com)
----------------------------------------------------------------------------------
NOTE :- For Any Clarification Please Comment Below
Comment,
Like and
Share us and help us to spread.
####--------------------------------------------------------------------------------------####
Subscribe :- http://www.youtube.com/user/itcloudnet?sub_confirmation=1
Website :- http://www.cloudnetwork.in
Facebook :- http://facebook.com/itcloudnetwork
Twitter :- http://twitter.com/itcloudnet
Pinterset :- http://pinterset.com/itcloudnet
LinkedIn :- http://in.linkedin.com/pub/itcloudnet
Google+ :- https://plus.google.com/u/0/107923552480070716949/posts
Skype Id :- cloud.network1
E-Mail Id :- itcloudnet@gmail.com
####----------------------------------------------------------------------------------------####
Thanking You
Hope U Like it........