: This article describes how to install the redisphp extension in ubuntu. if you are interested in the PHP Tutorial, refer to it.
1, if there is no phpize, first install the php5-dev
Sudo apt-get install php5-dev
2. get the latest redis code and compile and install it.
Wget http://redis.googlecode.com/files/redis-2.4.15.tar.gz
Tar xzvf redis-2.4.15.tar.gz
Cd redis-2.4.15
Make
Make install
3. install phpredis and obtain the latest version code for compilation.
Wget -- no-check-certificate http ://Github. Com/nicolasff/phpredis/tarball/master-O phpredis.tar.gz
Tar phpredis.tar.gz
Cd nicolasff-phpredis-f1231c9
Phpize
./Configure -- with-php-c/local/php/bin/php-config
Make
Make install
4. modify php. ini and add the redis. so module.
Vim/etc/php5/apache2/php. ini
Vim/etc/php5/cli/php. ini
Add the following line
Extension = redis. so
5. restart apache
/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/redis
Cp-fr ErikDubbelboer-phpRedisAdmin-9fcb29d/*/var/www/redis/
Open your browser and enter the following address:
Http: // 192.168.123.136/redis/
7. php test code
connect('127.0.0.1', 6379);$redis->set('key', 'hello world');echo $redis->get('key');?>
The above describes how to install the redisphp extension in ubuntu, including the github content. if you are interested in the PHP Tutorial.