Install redis extension without recompiling php

Source: Internet
Author: User
Tags php redis
1. You need to download a php redis extension source code for the required resources. You can download it here in advance. Github.comnicolasffphpredisarchivemaster.zip 2. installation 1. Unzip the package 123 first? Unzipphpredis

1. You need to download a php redis extension source code for the required resources. You can download it here in advance. Https://github.com/nicolasff/phpredis/archive/master.zip 2, installation 1, first extract 1 2 3? Unzip phpredis-master. zip? 2. Installation Note: first find the php installation directory, for example, in/usr/local/php

I. required resources

You need to download a php redis extension source code. You can download it here in advance. Https://github.com/nicolasff/phpredis/archive/master.zip

Ii. installation 1. Unzip the package first

1

2

3

?

Unzip phpredis-master.zip

?

2. Installation

Note: first find the php installation directory. The example is in/usr/local/php.

1

2

3

4

5

6

7

?

Cd phpredis-master

/Usr/local/php/bin/phpize

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

Make

Make install

?

3. Modify php. ini

Find php. ini and addextension=redis.so
Restart apache, nginx, or php-fpm

Iii. Test

Relatively simple test

1

2

3

4

5

6

?

$ Redis = newRedis ();

$ Redis-> connect ('2017. 0.0.1 ', 127 );

$ Redis-> set ('test', 'Hello world! ');

Echo $ redis-> get ('test ');

?

Original article address: Do not recompile php to install the redis extension. Thank you for sharing it with me.

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.