How to install the redis extension in php5.5: first download redis; then copy php_redis.dll and php_redis.pdb to the ext directory of php; then modify php.ini; and finally restart Apache.
The operating environment of this article: Windows 7 system, PHP version 5.5, DELL G3 computer
Use the phpinfo() function to view the version information of PHP. This will determine the extension file version
Based on the PHP version number, compiler version number and CPU architecture,
Select php_redis-2.2.5-5.5-ts -vc11-x86.zip and php_igbinary-1.2.1-5.5-ts-vc11-x86.zip
Download address:
http://windows.php.net/downloads/pecl /snaps/redis/2.2.5/
http://windows.php.net/downloads/pecl/releases/igbinary/1.2.1/
After decompression, copy php_redis.dll and php_redis.pdb to the ext directory of php
Modify php.ini, (PS: This php.ini file is In the Apache directory) add:
; php_redis extension=php_igbinary.dll extension=php_redis.dll
Note: extension=php_igbinary.dll must be placed in front of extension=php_redis.dll, otherwise this extension will not take effect
After restarting Apache, use phpinfo to check whether the extension is successfully installed
Create a new test.php page
<?php $redis=new Redis(); $redis->connect('192.168.1.11',6379); $redis->auth('123456'); $redis->set('test','helloworld'); echo $redis->get('test'); ?>
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of How to install redis extension in php5.5. For more information, please follow other related articles on the PHP Chinese website!