Home >Backend Development >PHP Tutorial >Compile and install PHP extension redis under Linux
The Linux environment is CentOS6.5 64-bit
Installing redis is relatively simple, there is nothing to say, just look at the official website, link: http://redis.io/download mainly look at the bottom.
After installing redis, copy the two commands in the generated directory src to /bin for easy calling
cp /var/soft/redis-2.8.19/src/redis-server /bin/redis-server redis 服务 cp /var/soft/redis-2.8.19/src/redis-cli /bin/redis-cli redis 客户端
Note: /var/soft/redis-2.8.19 is the directory where my redis software source code is located
Start redis service
redis-server /var/soft/redis-2.8.19/redis.conf
Add to self-start
echo "redis-server /var/soft/redis-2.8.19/redis.conf" >> /etc/rc.d/rc.local
Download address: http://pan.baidu.com/s/1nt3dfuT
Unzip:
tar zxvf phpredis-2.2.4.tar.gz
Enter the source code directory
cd phpredis-2.2.4
phpizeConfiguration
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
Open php.ini and add extension=xxxx/redis.so
Save and restart apache/nginx.
The above introduces the compilation and installation of the PHP extension redis under Linux, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.