Redis PHP extension phpredis installation note

Source: Internet
Author: User
Tags redis version

I 've been playing redis for a while, and it's been a long time. I 've recorded a little bit of it.

OldArticleHere: http://www.cnblogs.com/scotoma/archive/2010/12/05/1897067.html

Here we mainly write the extension of redis in PHP. It was originally intended to use PHP 5.3.4 in the production environment, but I feel that PHP is not very recommended for official PHP 5. 3. * function, the new Zend framework2.0 does not continue to update, so it is returned to 5.2.16.

I don't need to say why I used redis. I didn't plan to continue using predis after I returned the redis version 5.2.16. I checked it on the official redis website. I felt that the version was changed a lot and I changed my independent domain name, the new domain name is as follows: http://redis.io/

Reading the new tutorials found very good, it is recommended to look at: http://try.redis-db.com/

Now I will mainly talk about the installation of phpredis extension. This extension is written in C, and the performance should be much better than that of predis. It feels good to use it after installation.

The installation procedure is as follows:

 
1. Download Code: git clone https://github.com/owlient/phpredis.git
 
2. phpize
 
(If you use centos, u shocould use the full path
 
/Usr/local/PHP/bin/phpize
 
)./Configure
 
(If get error, shocould change it
./Configure -- With-PHP-Config =/usr/local/PHP/bin/PHP-config
 
) Make & make install
 
3. Edit PHP. ini and add Extension
 
Extension = redis. So
 
4. Restart U Server
 
Result This is displayed after the installation is completed in the preceding steps. For more information, see phpinfo.

Started to use after installation

The instructions are as follows:

Https://github.com/owlient/phpredis

TestCodeHere:

Dump:

String (11) "Hello World" string (9) "xinqiyang"

Update: 20110721

Related Article

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.