Home  >  Article  >  Backend Development  >  How to install php redis under windows

How to install php redis under windows

藏色散人
藏色散人Original
2020-10-20 10:01:161902browse

How to install php redis under windows: first obtain the corresponding phpRedis extension file; then double-click to open the "php_redis-2.2.7-5.6-ts-vc11-x86.zip" file; finally edit php. ini file and restart the service.

How to install php redis under windows

Recommended: "PHP Video Tutorial"

Installing phpRedis extension under Windows

There are many tutorials and blogs on the Internet for installing phpRedis extensions. I personally tested that the following one can be used, so I will go to

Installing phpRedis extensions under Windows

Usually when testing PHP programs, you will Redis is used. Generally, tests are conducted under Windows, so the phpRedis extension needs to be installed in the Windows environment to support PHP's access to Redis.

Tools/Materials

1.php debugging environment (WAMP3 32-bit is used here, php version 5.6)

2.phpRedis extension file for Windows

3. Text editor (notepad notepad)

Method/step

First we need to obtain the corresponding phpRedis extension file.

Enter https://pecl.php.net/package/redis in the web browser or click here to open the corresponding website.

Since the latest version 3.0.0 only supports php7.0, we choose to support the php5.6 version of the extension.

After opening the link, find the file corresponding to the php5.6 version.

The WAMP environment I use is a 32-bit version, so I selected the "5.6 Thread Safe(TS) x86" option.

After the download is completed, double-click to open the php_redis-2.2.7-5.6-ts-vc11-x86.zip file. The php_redis.dll is the php extension we need to use.

Open the directory where the PHP extension is loaded in the development environment, here is C:\wamp\bin\php\php5.6.19\ext. Unzip the php_redis.dll file obtained in the previous step into the current directory.

Click on the WAMP icon and select PHP, php.ini in turn.

Open WAMP's PHP.ini configuration file. We need to let PHP know to load the phpRedis extension.

Look for content similar to the beginning of "extension=" when opening the php.ini file for editing. For example: extension=php_bz2.dll.

Add a line "extension=php_redis.dll" (without quotes) to these loaded contents.

Close and save after adding.

Restart the WAMP service and confirm whether the phpRedis extension is loaded correctly as shown.

If you see the word php_redis in php extensions and check it, congratulations, it means the loading is successful!

Notes

1. Select the version of the phpRedis extension, which should be consistent with the version of the PHP environment being used. For example, php5.6 or 7.0, 32-bit or 64-bit.

Before installing the phpRedis extension, it is best to have the Redis service installed so that you can easily test whether the extension is effective.

The above is the detailed content of How to install php 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