【一】、 先安装redis服務端
C:\redis
a). c:\redis>cd redis
b). c:\redis>redis-server.exe redis.windows.conf 直接回車,但通常會報錯,這是為什麼呢?見錯誤信息如下:“
The window version of Redis allocates a memory mapped heap for sharing with the forked process used for persistence operations(窗口的复述,分配一个内存映射派生进程堆分享与用于持久化操作)”
c). 用編輯器打開redis.windows.conf
找到 maxheap 1024000000 改为 maxheap 10240000 即可
e). c:\redis>redis-server.exe redis.windows.conf 直接回車,即看到如下啟動成功畫面
c:\redis>redis-server.exe redis.windows.conf
_._
_.-“__ ”-._
_.-“ `. `_. ”-._ Redis 2.8.2101 (00000000/0) 64 bit
.-“ .-“`. “`\/ _.,_ ”-._
( ‘ , .-` | `, ) Running in stand alone mode
|`-._`-…-` __…-.“-._|’` _.-‘| Port: 6379
| `-._ `._ / _.-‘ | PID: 8776
`-._ `-._ `-./ _.-‘ _.-‘
|`-._`-._ `-.__.-‘ _.-‘_.-‘|
| `-._`-._ _.-‘_.-‘ | http://redis.io
`-._ `-._`-.__.-‘_.-‘ _.-‘
|`-._`-._ `-.__.-‘ _.-‘_.-‘|
| `-._`-._ _.-‘_.-‘ |
`-._ `-._`-.__.-‘_.-‘ _.-‘
`-._ `-.__.-‘ _.-‘
`-._ _.-‘
`-.__.-‘[8776] 15 Oct 02:42:58.309 # Server started, Redis version 2.8.2101
[8776] 15 Oct 02:42:58.319 * DB loaded from disk: 0.010 seconds
[8776] 15 Oct 02:42:58.319 * The server is now ready to accept connections on port 6379
_._
_.-“__ ”-._
_.-“ `. `_. ”-._ Redis 2.8.2101 (00000000/0) 64 bit
.-“ .-“`. “`\/ _.,_ ”-._
( ‘ , .-` | `, ) Running in stand alone mode
|`-._`-…-` __…-.“-._|’` _.-‘| Port: 6379
| `-._ `._ / _.-‘ | PID: 8776
`-._ `-._ `-./ _.-‘ _.-‘
|`-._`-._ `-.__.-‘ _.-‘_.-‘|
| `-._`-._ _.-‘_.-‘ | http://redis.io
`-._ `-._`-.__.-‘_.-‘ _.-‘
|`-._`-._ `-.__.-‘ _.-‘_.-‘|
| `-._`-._ _.-‘_.-‘ |
`-._ `-._`-.__.-‘_.-‘ _.-‘
`-._ `-.__.-‘ _.-‘
`-._ _.-‘
`-.__.-‘[8776] 15 Oct 02:42:58.309 # Server started, Redis version 2.8.2101
[8776] 15 Oct 02:42:58.319 * DB loaded from disk: 0.010 seconds
[8776] 15 Oct 02:42:58.319 * The server is now ready to accept connections on port 6379
【二】、PHP安装redis扩展
1. 将php_igbinary.dll和php_redis.dll拷贝至PHP扩展文件夹内
2. 編輯php.ini
E:\wamp\bin\apache\apache2.4.9\bin\php.ini
添加如下,加入擴展,需要注意的是php.igbinary.dll一定要放在前面
extension=php_igbinary.dll
extension=php_redis.dll3. 輸出phpinfo即可看到成功
2. 編輯php.ini
E:\wamp\bin\apache\apache2.4.9\bin\php.ini
添加如下,加入擴展,需要注意的是php.igbinary.dll一定要放在前面
extension=php_igbinary.dll
extension=php_redis.dll3. 輸出phpinfo即可看到成功
3. laravel 裡面的 .env文件修改
CACHE_DRIVER=redis
SESSION_DRIVER=redis
去打赏