PHP configuration and instructions for extending redis under windows

不言
Release: 2023-03-23 13:46:02
Original
1536 people have browsed it

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
Copy after login
Copy after login

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
Copy after login
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!