mac環境下安裝Redis

來源:互聯網
上載者:User

標籤:mac php redis

參考文章:http://www.jianshu.com/p/6b5eca8d908b1.安裝

下載安裝包 redis-*.*.*.tar.gz

官網地址:http://redis.io/download


解壓:tar -zvxf redis-*.*.*.tar.gz  將解壓後的檔案夾放到 /usr/local目錄下

編譯測試:


接下來在終端中切換到/usr/local/redis目錄下,輸入:sudo make test


詳情如下....



$ wget http://download.redis.io/releases/redis-3.2.8.tar.gz$ tar xzf redis-3.2.8.tar.gz$ cd redis-3.2.8$ make

         

The binaries that are now compiled are available in the            src            directory. Run Redis with:

$ src/redis-server

         

You can interact with Redis using the built-in client:

$ src/redis-cliredis> set foo barOKredis> get foo"bar"


2.擴充        

有沒有安裝redis擴充:可先在自己的demo中查看phpinfo.php

<?phpecho phpinfo();


舉例在thinkphp3.2.3項目中,使用redis,

1.看教程:

http://www.thinkphp.cn/code/1458.html

2.下載redis.rar,查看說明。


cd /usr/local/php5

sudo cp -r ~/Downloads/redis/redis擴充檔案/ ./


3.添加了config.conf,



3.先確保php的redis擴充已經安裝好。

http://demo.ccc/default/phpinfo.php


如沒有安裝好?mac 中安裝redis 以及 安裝php-redis擴充過程詳細記錄

http://www.cnblogs.com/neverleave/p/6309063.html



4.,找到 /private/etc/php.ini

Php.ini加下面兩行:

extension=php_igbinary.dll

extension=php_redis.dll

註:php_redis.dll需放在php_igbinary.dll之後


==

php-fpm重啟

killall php-fpm 

再執行(usr/local/php是php的安裝目錄)
/usr/local/php/sbin/php-fpm &




出現:

:(

Redis server went away


是不是防火牆被關閉了。

查看,系統喜好設定。

650) this.width=650;" src="https://s2.51cto.com/wyfs02/M00/92/A0/wKiom1kBbDzzIJlWAANoZh9n3VU204.png" title="mac-redis.png" alt="wKiom1kBbDzzIJlWAANoZh9n3VU204.png" />








mac環境下安裝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.