Install phpredisubuntu in ubuntu? 1. install redis server sudoapt-getinstallredis-server to test whether redis is successfully installed: Note: To enable redisredis-clisetmynamewangki install php redis in ubuntu
Install php redis in ubuntu
?
1. install the redis server
Sudo apt-get install redis-server
Test whether redis is successfully installed:
Note: To enable redis
Redis-cli
Set myname wangking
OK
Get myname
"Wangking"
?
2. download and install the php extension plug-in phpredis of redis.
Sudo wget http://open.imop.us/pr.tar.gz
Tar zxvf pr.tar.gz
Cd phpredis
Phpize // This phpize is installed on the php module
If you do not have phpize, you need to install the php5-dev first (apt-get install php5-dev)
./Configure
Make
Sudo make install
Modify the php. ini file (/etc/php5/apache2/php. ini)
Extension = redis. so
Restart apache (sudo/etc/init. d/apache2 restart)
?
Php test demo:
$redis = new Redis();$redis->connect('127.0.0.1',6379);$redis->set('myname','wangking');echo $redis->get('test');
?
?
?