redis本地安裝

來源:互聯網
上載者:User

標籤:redis

                                                     redis在本地的安裝及使用

1、首先下載redis安裝包,如下  

http://pecl.php.net/package/redis/2.2.7/windows

輸入phpinfo()查看php版本進行相應的下載,注意版本

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/6E/A1/wKioL1WBQI2gQJ2kAAB7u8zWXxY827.jpg" title="A(B3PV79J6E5LP9IOHJ9EJO.png" alt="wKioL1WBQI2gQJ2kAAB7u8zWXxY827.jpg" />

2、下載完成後將php_redis.dll放到ext下,在php.ini中添加extension=php_redis.dll

3、重啟伺服器



擴充安裝完成後安裝redis本機伺服器

https://github.com/dmajkic/redis/downloads。下載到的Redis支援32bit和64bit。根據自己實際情況選擇

開啟cmd運行進行安裝

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/6E/A1/wKioL1WBQcWzVpjtAAILnTrDvXc958.jpg" title="(6_UD{M06NL`EBI%HVTL@UJ.jpg " alt="wKioL1WBQcWzVpjtAAILnTrDvXc958.jpg" />

說明redis已經安裝成功了

再開啟一個cmd

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/6E/A1/wKioL1WBQnCAXM1NAAF2Goj-3vk494.jpg" title="VO7PK]62C6K8GY8P)0I9RHU.png" alt="wKioL1WBQnCAXM1NAAF2Goj-3vk494.jpg" />

至此,說明redis已經安裝完成


php代碼測試如下

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

這樣可以存值取值即可


本文出自 “fiting” 部落格,請務必保留此出處http://zrwx123.blog.51cto.com/10193196/1662861

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.