Home  >  Article  >  Backend Development  >  How to install redis extension in php5.5

How to install redis extension in php5.5

藏色散人
藏色散人Original
2021-05-13 09:42:462145browse

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.

How to install redis extension in php5.5

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

How to install redis extension in php5.5

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/

How to install redis extension in php5.5

After decompression, copy php_redis.dll and php_redis.pdb to the ext directory of php

How to install redis extension in php5.5

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

How to install redis extension in php5.5

After restarting Apache, use phpinfo to check whether the extension is successfully installed

How to install redis extension in php5.5

Create a new test.php page

<?php
 $redis=new Redis();
 $redis->connect(&#39;192.168.1.11&#39;,6379);
 $redis->auth(&#39;123456&#39;);
 $redis->set(&#39;test&#39;,&#39;helloworld&#39;);
 echo $redis->get(&#39;test&#39;);
?>

How to install redis extension in php5.5

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn