windows下安裝redis 並擴展php redis

廢話不多說  直接來步驟


1、下載windows版本的  下面是我自用的  

http://url.cn/5kGcteF       密碼 :  0S3Xy2


2、下載php redis擴展文件, 注意:下面的是擴展對應的版本是php5.4nts,如果版本不同就自行百度吧

http://url.cn/55IAPcu     密碼: CqpAT1


3、把下載的windows版的redis放到自定義的目錄 ,打開cmd, 啓動redis服務,

redis-server.exe redis.windows.conf


3.1其中可能會報錯:如下 : 由於沒有指定maxheap導致的,當然了不指定該參數不一定報錯,但是出現上述原因,通常是這個原因導致的

The Windows version of Redis allocates a memory mapped heap forsharing with


the forked process used for persistenceoperations. In order to share this


memory, Windows allocates from the systempaging file a portion equal to the


size of the Redis heap. At this time thereis insufficient contiguous free


space available in the system paging filefor this operation (Windows error


0x5AF). To work around this you may eitherincrease the size of the system


paging file, or decrease the size of theRedis heap with the --maxheap flag.


Sometimes a reboot will defragment thesystem paging file sufficiently for


this operation to complete successfully.



Please see the documentation included withthe binary distributions for more


details on the --maxheap flag.


解決方法:redis-server.exe --maxheap 500m  


3.2:redis 開機自動啓動服務 

開始-》運行-》regedit  打開註冊表 

HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run 

在Run下 新建一個字符串值

名稱是 scenewood   數據值:      "redis-server.ext的路徑"  :例如: "I:\extend\redis\redis-server.exe"

如果是3.1的操作  這是的字符串值這樣寫 :    "I:\extend\redis\redis-server.exe" --maxheap 500m   就可以了


4:安裝php redis擴展

將下載來的 php_redis.dll 和 php_igbinary.dll 放在 php的ext的目錄下  


4.1:編輯php.ini 

extension=php_igbinary.dll
extension=php_redis.dll


4.2重啓apache  就可以redis了   ,注意一點在php裏使用redis ,要注意redis服務是否開啓




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章