Install Phpredis under Linux

Source: Internet
Author: User
Tags phpinfo
Phpredis is a redis extension for PHP, and the PHP code can operate the Redis database only if Phpredis is installed. Only the methods for installing Phpredis are described below.

1. Download Phpredis, download directly from official git to local directory (~/soft/)

git clone https://github.com/jiangtong1125/phpredis.git (no git installed, can also be packaged and downloaded)

2. Enter the Phpredis directory

CD ~/soft/phpredis/

3. Execute phpize,/usr/local/php/bin/phpize (if there are multiple PHP versions locally, use the correct version)

4. Compile./configure--with-php-c/local/php/bin/php-config

5. Compile, directly perform make&&make install, install complete result

6. Go to the Red Flag directory and copy the redis.so file in the directory to the PHP extension directory.

How do I view the PHP extensions directory? Execute Phpinfo, Extension_dir is,

Copy to this directory

7. Add extension=redis.so to PHP.ini

8. Restart Apache and view Phpinfo again

Well done, happy to play!!!

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

The above describes the Linux installation Phpredis, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.

  • 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.