Redis + php擴充的安裝與配置(windows)

來源:互聯網
上載者:User

標籤:

-->安裝Redis服務
下載redis安裝包 http://pan.baidu.com/s/1pJiVFHx
下載後解壓 把解壓後檔案夾裡面的檔案(根據自己的系統位元選擇32位或者64位)拷貝到D盤建立的檔案夾,並重新命名為redis
按"Windows + R" 輸入cmd 開啟命令列工具
--> d:   (進入D盤)
--> cd redis   (進入redis目錄)
--> redis-server.exe redis.conf   (啟動redis服務)

測試redis是否安裝成功
--> 新開啟一個命令列 cmd
--> d:   (進入D盤)
--> cd redis   (進入redis目錄)
--> redis-cli.exe   (進入redis命令操作)
--> set test "Hello World"
--> get test

如果成功列印出 Hello World 表示Redis安裝成功
-->安裝PHP Redis 擴充
下載php_redis.dll擴充(要下載和當前使用的PHP版本對應的擴充檔案,我用的是php 5.5)
http://pan.baidu.com/s/1mgInDZM
下載後解壓 有32位和64位區分 選擇對應的解壓 把解壓後的檔案放到PHP安裝包下的ext檔案夾中 D:/wamp/bin/php/php5.5.12/ext
php_igbinary.dll php_redis.dll 兩個檔案
然後開啟php.ini
輸入:

extension=php_igbinary.dll
php_redis.dll

順序也要這樣,然後重啟apache服務

在開發目錄寫一個php檔案測試一下:
<?php
  $redis = new Redis();
  $redis->connect(‘127.0.0.1‘,6379);
  $redis->set(‘test‘,‘hello redis‘);
  echo $redis->get(‘test‘);
?>
輸出hello redis 說明安裝成功了。

推薦一個可視化的Redis工具
http://pan.baidu.com/s/1c08u2Lq

傻瓜式安裝就可以,開啟後點擊Connect to Redis Server 輸入名稱和IP地址 連結後就可以看到效果。

Redis + php擴充的安裝與配置(windows)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.