Add Redis module in PHP

Source: Internet
Author: User
: This article mainly introduces how to add the Redis module in PHP. if you are interested in the PHP Tutorial, refer to it. Several articles have introduced the installation and use of Redis. The following describes how to add Redis extension in php!

The php Manual does not provide Redis classes and methods or related extension modules, but we can download PHP extensions from the official Redis website, take phpredis as an example.

  1. Download phpredis
    1. Click "Repository" to enter the Redis Learning Library, which contains the Redis extended code file and related introduction and classes and methods.
    2. Click "releases" to go to the phpredis source file.
    3. Download the latest phpredis source file and select "tar.gz" to download it.
  2. Phpredis configuration
    1. Decompress the phpredis file

      1 tar -zxvf phpredis-2.2.7.tar.gz

    2. Install and configure phpredis
      1. Run the phpize5 command in the phpredis directory to generate the configure file

        phpize5

      2. Install and configure igbinary

        wget http://pecl.php.net/get/igbinary-1.2.1.tgz./configuremakesudo make install

      3. Install and configure phpredis

        ./configure --enable-redis-igbinarymake 
        sudo make install

      4. Modify php. ini and add (add igbinary. so first and then redis. so in order)

        extension=igbinary.soextension=redis.so

  3. View phpredis

View with phpinfo ()

Reference:

Php-Redis installation test summary

The above describes how to add the Redis module in PHP, including related content, and hope to help those who are interested in the PHP Tutorial.

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.