How to install redis3.0 extension in php: 1. Download redis3.0; 2. Extract the downloaded file to your computer; 3. Start the redis service; 4. Install the redis extension of php; 5. php Just connect and test the redis database.
The operating environment of this article: Dell G3 computer, Windows7 system, PHP7.2 version
How to use php Install redis3.0 extension?
Installing php redis extension (php7.2 redis3.0) under Windows 64-bit
Prerequisite: The prerequisite for building the redis extension for php7.2 is on this machine The running environment of php has been successfully set up. The running environment of my computer is apache2.4 mysql5.5 php7.2.
The operating system is 64-bit, and the compilation environment isMicrosoft visual C 2017 Redistributable
1Download redis3.0: https://github.com/MSOpenTech/redis/releases
2 Extract the downloaded file to your computer ( D:\redis), the installation is completed. [Recommended: "PHP Video Tutorial"]
#redis-cli.exe
# Redis-Server.exe#Servercompletely.windows.conf#Configuration file
## 3 redis service
Jump to the redis installation directory in the command line window (windows key R key->, enter the cmd command to enter the DOS operating system window->enter the redis installation directory ), enter redis-server redis.windows.conf in the window and press Enter. If the following interface appears, the reids service is successfully installed and started:
4 Install the redis extension of php
https://windows.php.net/downloads/pecl/snaps/redis/3.1.4/
Download the corresponding redis driver file according to the version information of php
phpinfo() information
Select the corresponding file
##4.2 Unzip the downloaded php_redis driver file, find the php_redis.dll and php_redis_pdb files and copy them to the ext folder of php .
Copy to
=php_redis.dll or extension = php_redis
##4.4 Verify whether the redis extension is enabled
Use phpinfo() to check if the redis extension description has been added successfully
5.5
##index.php file:
##
<?php $redis = new Redis(); $redis->connect('127.0.0.1', 6379); $redis->set("name", "redis3.1"); echo $redis->get("name"); ?>
Access index, the php file page displays redis3.1
Recommended: "PHP Video Tutorial"
The above is the detailed content of How to install redis3.0 extension in php. For more information, please follow other related articles on the PHP Chinese website!