PHP extension redis compilation and installation in Linux

Source: Internet
Author: User
: 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.