Home >Backend Development >PHP Tutorial >Install redisphp extension on ubuntu
1. If there is no phpize, first install php5-dev
sudo apt-get install php5-dev
2. Get the latest redis code, compile and install
wget http://redis.googlecode.com/files/ redis-2.4.15.tar.gz
tar -no-check-certificate http://
github
.com/nicolasff/phpredis/tarball/master -O phpredis.tar.gz
tar phpredis.tar.gz
phpize
./configure --with-php-c/local/php/bin/php-configmake make install
4, modify php.ini, add redis.so module
vim /etc/php5/apache2/php.ini
vim /etc/php5/cli/php.ini
Add the following line
/etc/init.d/apache restart
6, download the redis WEB management package
wget --no-check-certificate https://
github.com/ErikDubbelboer/phpRedisAdmin/tarball/master -O phpRedisAdmin.tar.gz
tar xzvf phpRedisAdmin.tar.gz
mkdir /var/www/rediscp -fr ErikDubbelboer-phpRedisAdmin-9fcb29d/* /var/www/redis/
Open the browser and enter the following Address:
http://192.168.123.136/redis/
7, php test code
<?php $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->set('key', 'hello world'); echo $redis->get('key'); ?>
The above introduces the installation of redisphp extension on ubuntu, including the github content. I hope it will be helpful to friends who are interested in PHP tutorials.