Linux How to install Redis Extensions for PHP

Source: Internet
Author: User
Tags install redis
This article is mainly to share with you the Linux installation of the Redis extension of the method, I hope to help everyone.

1. Download Phpredis
Download Address: https://github.com/nicolasff/phpredis/archive/2.2.4.tar.gz

2. Installing Redis
Upload the phpredis-2.2.4.tar.gz to the/USR/LOCAL/SRC directory, then execute the command in turn:
CD/USR/LOCAL/SRC #进入软件包存放目录
Tar zxvf phpredis-2.2.4.tar.gz #解压
CD phpredis-2.2.4 #进入安装目录
/usr/local/php/bin/phpize #用phpize生成configure配置文件
./configure--with-php-config=/usr/local/php/bin/php-config #配置
Make #编译
Make install #安装
After the installation is complete, the following installation path appears
/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/
Make Test #测试
You will be prompted to configure the php.ini file

3. Configure PHP Support
Vim/usr/local/php/etc/php.ini #编辑配置文件, add the following on the last line
extension= "Redis.so"

4. Restart Service
sudo service nginx restart

SUDO/ETC/INIT.D/PHP-FPM restart

Viewing phpinfo information from the browser see a redis extension, which means the installation was successful


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.