: This article describes how to compile and install PHP extension redis in Linux. For more information about PHP tutorials, see. CentOS6.5 64-bit in Linux
Install redis is relatively simple, there is nothing to say, look at the official website on the line, link: http://redis.io/download mainly look at the bottom of the thing.
After redis is installed, copy the two commands in the generated directory src to/bin for convenient calling.
Cp/var/soft/redis-2.8.19/src/redis-server/bin/redis-server redis service cp/var/soft/redis-2.8.19/src/redis-cli/bin/redis-cli redis client
Note:/var/soft/redis-2.8.19 is my redis software source code directory
Start redis service
redis-server /var/soft/redis-2.8.19/redis.conf
Add to auto-start
echo "redis-server /var/soft/redis-2.8.19/redis.conf" >> /etc/rc.d/rc.local
Install phpredis extension
: Http://pan.baidu.com/s/1nt3dfuT
Decompress:
tar zxvf phpredis-2.2.4.tar.gz
Go to the source code directory
cd phpredis-2.2.4
Use phpize to generate the configure File (phpize is in the php installation directory/bin)
phpize
Configuration
./configure --with-php-config=/usr/local/php/bin/php-config
Compile and install
make && make install
The Directory of redis. so appears after the operation is successful.
Open php. ini and add extension = xxxx/redis. so
Save and restart apache/nginx.
The above introduces the PHP extension redis compilation and installation in Linux, including some content, and hope to be helpful to friends who are interested in PHP tutorials.