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