Home  >  Article  >  Backend Development  >  PHP configuration and instructions for extending redis under windows

PHP configuration and instructions for extending redis under windows

不言
不言Original
2018-04-10 15:46:001545browse

The content of this article is to share with you the configuration and instructions of php extending redis under windows. It has certain reference value. Friends in need can refer to it


Operation prerequisite


#window The redis service must be installed and turned on.
If not, please click to view

Summary

We have to do four major steps in total

The first step

View your own phpconf().

PHP configuration and instructions for extending redis under windows

Second step

Download igbinary This thing
There are two files in total
Click to download

Download the corresponding version
PHP configuration and instructions for extending redis under windows
Then put the two red files in the compressed file into the php ext directory.
PHP configuration and instructions for extending redis under windows

The third step

Download phpredis extension
Click to download
Download the corresponding version, x86 or x64

Similarly put the two files in the php ext directory
PHP configuration and instructions for extending redis under windows

The third step

Add two lines to php.ini:

extension=php_igbinary.dll
extension=php_redis.dll

Check whether the redis extension is included in phpinfo
If it is extended, you can directly use it as a new object.

//实例化redis
    $redis = new Redis();    //连接
    $redis->connect('127.0.0.1', 6379);    //检测是否连接成功
    echo "Server is running: " . $redis->ping();    // 输出结果 Server is running: +PONG

Operation premise

Window must install the Redis service and have already turned on.
If not, please click to view

Summary

We have to do four major steps in total

The first step

View your own phpconf().

PHP configuration and instructions for extending redis under windows

Second step

Download igbinary This thing
There are two files in total
Click to download

Download the corresponding version
PHP configuration and instructions for extending redis under windows
Then put the two red files in the compressed file into the php ext directory.
PHP configuration and instructions for extending redis under windows

The third step

Download phpredis extension
Click to download
Download the corresponding version, x86 or x64

Similarly put the two files in the php ext directory
PHP configuration and instructions for extending redis under windows

The third step

Add two lines to php.ini:

extension=php_igbinary.dll
extension=php_redis.dll

Check whether the redis extension is included in phpinfo
If it is extended, you can directly use it as a new object.

//实例化redis
    $redis = new Redis();    //连接
    $redis->connect('127.0.0.1', 6379);    //检测是否连接成功
    echo "Server is running: " . $redis->ping();    // 输出结果 Server is running: +PONG

The above is the detailed content of PHP configuration and instructions for extending redis under windows. 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