Windows下Redis的安裝

來源:互聯網
上載者:User

標籤:font   取資料   uninstall   檔案   family   github   技術分享   啟動   停止   

 

動手之前,請確認Windows所用使用者為administrator

 

:https://github.com/MicrosoftArchive/redis/releases

 

下載後雙擊開啟進行安裝

 

完事之後

 

進入安裝目錄

開啟命令列:按住shift點右鍵->在此處開啟命令視窗

redis-server.exe redis.windows.conf  敲斷行符號


如果出現一個大圖案 或者啥也沒出現 都算正常 只要沒報錯就行

 

 

也可以開啟目錄中redis.log裡查看啟動流程

 

雙擊目錄中的用戶端 redis-cli.exe
set get 試一下 存取資料沒問題 證明Redis已經成功運行

 

 

開啟命令視窗

 

註冊成服務開機自啟:redis-server --service-install redis.windows.conf

 

啟動服務:redis-server --service-start

停止服務:redis-server --service-start

卸載服務:redis-server --service-uninstall

 

 

下載擴充:

https://pecl.php.net/package/redis

切記 一定要下載符合情況的 你的PHP版本 是否安全執行緒
下載之後開啟 把裡面的php_redis.dll拷貝到php的安裝目錄裡ext下

 

開啟php.ini加入
extension=php_redis.dll

 

重啟Apache

 

查看phpinfo() 是否有了Redis擴充

 

 

建立php檔案
<?php
$redis = new Redis();
$redis->connect(‘127.0.0.1‘, 6379);
$redis->set("name", "hello world");
echo $redis->get("name");

 

Windows下安裝Redis流程就這樣  關於Linux下Redis的安裝請移步Linux分類

 

感謝閱讀

 

Windows下Redis的安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.