Added redis extension and php7redis extension in php7

Source: Internet
Author: User
Tags zts

Added redis extension and php7redis extension in php7
Add redis extension in PHP7 1. Purpose:

Recently, a new environment was deployed, using PHP7 + nginx and memcache for the old version of nosql. The new version was prepared with redis, So I installed the redis extension.

2. Description:

In fact, you don't need to pay attention to redis extension installation. The main reason is to pay attention to whether the extension supports the PHP version when downloading the extension. Other installation methods are consistent with the common PHP extension installation method.

3. installation steps:

1. Download

: Http://pecl.php.net/package/redis

The download directory is stored in/data/download/php.

Cd to the download directory, download: wget http://pecl.php.net/get/redis-3.1.2.tgz

2. Extract

Unzip to the current directory tar-zxvf redis-3.1.2.tgz

3. Install

Under the cd redis-3.1.2 directory

Use phpize in this directory to generate the configure configuration file: Run/usr/local/php7/bin/phpize directly.

The configuration, compilation, and installation are all completed in this directory.

./Configure -- with-php-config =/usr/local/php7/bin/php-config

Make

Make install

After make install, you will see Installing shared extensions:/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/

This directory is the directory where the redis. so file is generated

Ll/usr/local/php7/lib/php/extensions/no-debug-non-zts-20160303/

Redis. so indicates that the installation is successful.

4. The configuration supports PHP7:

Vim/usr/local/php7/etc/php. ini

Add extension = redis. so

: Wq!

5. Restart nginx. Restart php-fpm.

Reference: http://www.cnblogs.com/yangxia-test/p/4195198.html

  

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.