Showing posts with label redis. Show all posts
Showing posts with label redis. Show all posts

Wednesday, September 7, 2022

Redis on Windows

 最近要在Windows起一個Redis:

先使用 Windows 子系統 Linux 版 安裝 Linux ,開一個Powershell。

輸入: wsl --install

按照指示進行安裝,自動重啓後就會進入ubuntu界面,如果之後要再入ubuntu,用cmd輸入bash即可。


安裝Redis:

  • curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
  • echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
  • sudo apt-get update
  • sudo apt-get install redis


設定路徑在︰/etc/redis/redis.conf

執行路徑在︰/etc/init.d/redis-server start


需要打開ubuntu防火牆︰sudo ufw allow 6379

Friday, November 9, 2018

Error: [0] BadFunctionCallException in Redis.php line 44 不支持: redis

在安裝thinkphp系統時,出現這個錯誤,原來是redis沒有放到php目錄下。


  1. 先在這裏下載php_redis.dll
  2. 然後解壓縮到php/ext/目錄中。
  3. 在php.ini加入extension=php_redis.dll
  4. 最後重啓apache就可以了。