The PHP Redis client will be phpredis
At first, we have to be sure that php5.6-dev is installed.
1 |
sudo apt-get install php5.6-dev |
Then install package
1 |
sudo pecl install redis |
in type installation, you will be asked a few times and always answer no
and last you need to add to the php.ini file this line and restart apache2 server
1 |
extension=redis.so |
Now we can test our Redis by executing this code
1 2 3 4 5 6 |
<?php $redis = new Redis(); $redis->connect('127.0.0.1', 6379); echo $redis->set('hello', 'here we go', 60)."\n"; echo $redis->get('hello'); ?> |
Main Redis client on your ubuntu must have been installed, if still not, use this video instruction
If you don’t understand something, you can always ask me by commenting on this post