php中Redis配置小解

來源:互聯網
上載者:User

標籤:

已PHP5.4+Redis3.0+widows系統介紹一下具體配置

Redis官方 http://www.redis.io/download

1.最新版本的Redis需運行在PHP5.4及以上版本,低於5.4的PHP版本可能不支援

2.PHPVersion中查詢PHP的擴充模式,是NTS還是TS,下載對應的Redis擴充庫,擴充庫 https://github.com/phpredis/phpredis/downloads

4.加對應的擴充庫放置在php的擴充檔案夾(ext)下

5.php的設定檔php.ini,新增配置

extension=php_igbinary.dll
extension=php_redis.dll

 

6.重啟Apache服務,開啟首頁,查看redis擴充是否已配置成功

7.開始你的Redis之旅吧

 1 $redis=new Redis(); 2 // print_r($redis); 3 $redis->connect(‘localhost‘,6379); 4 $redis->select(0); 5 // echo $redis->get(‘test12345‘); 6 $redis->set(‘key‘,‘this is a test‘); 7 echo ‘Redis-cli已串連<br/>‘; 8 echo $redis->get(‘key‘); 9 echo ‘<hr/>‘;10 $redis->close();

 

php中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.