Redis php installation and expansion

1. Download redis and the corresponding expansion php_redis.dll, Download https://pecl.php.net/package/redis  I chose the version 3.0.0, corresponding to redis install version 3.0 (downloaded directly under the ignore step) 2 Notes, see your PHP version corresponding with PHPinfo, do not install the wrong. ps: If you see php7ts.dll select ts version in the PHP directory, nts or ts sure to download the corresponding extension.  

3. ext directory under decompression, the php_redis.dll copied to the php

4. Modify php.ini, (PS: This is Apache php.ini file directory) is added in the file: extension = php_redis.dll

5. Restart Apache, see the expanded use phpinfo phpinfo is successfully installed to view information again, search redis, appear under the diagram means that successfully opened. 

6. Open the redis service, you can use the following test whether calls.

<?php
// connect local Redis service
$ Repeat newRedis = ();
$redis->connect('127.0.0.1', 6379);
echo"Connection to server sucessfully";
// set data string redis
$redis->set("tutorial-name","Redis tutorial");
// get the stored data and output
echo"Stored string in redis:: ". $redis->get("tutorial-name");
?>
 

 

Guess you like

Origin www.cnblogs.com/xiaogou/p/11655583.html