在windows環境下安裝redis和phpredis的擴充

來源:互聯網
上載者:User

標籤:

在windows環境下安裝redis和phpredis的擴充

1.首先配置php:

需要在windows的Integration Environment中找到php的擴充檔案夾,ext,然後在網上尋找自己的php對應的.dll檔案

比如說的我的phpinfo裡面顯示是Arti。。:x86,所以需要選擇X86,這個跟系統無關,我的系統還是64位的呢!

然後我的Integration Environment是ts而不是nts這個都可以在phpinfo檔案中找到!

下載檔案php_igbinary.dll,php_redis.dll

然後修改設定檔php.ini(php檔案夾中的和Apache中的)

extension=php_igbinary.dll

extension=php_redis.dll

2.在安裝windows的redis,redis很像綠色版的軟體,直接把檔案夾拷貝到一個檔案夾中,然後再開啟兩個dos視窗,一個啟動服務,一個作為用戶端執行命令

3.最後在phpinfo中可以找到這個redis擴充,還可以在www目錄下寫一個testredis.php

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

輸出正確則運行成功

在windows環境下安裝redis和phpredis的擴充

聯繫我們

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