PHP Redis 裝配

來源:互聯網
上載者:User
PHP Redis 安裝

?

PHP Redis 安裝

?

目錄:[?-?]

  • 20.4.4.?php-redis.x86_64 : Extension for communicating with the Redis key-value store
  • 20.4.4.1.?pecl 安裝
  • 20.4.4.2.?yum安裝
  • 20.4.4.3.?源碼編譯安裝
  • 20.4.4.4.?配置 redis.ini
  • 20.4.4.5.?Session 配置

?

文章出處:http://netkiller.github.io/

?

20.4.4.?php-redis.x86_64 : Extension for communicating with the Redis key-value store

20.4.4.1.?pecl 安裝

pecl install redis

20.4.4.2.?yum安裝

https://github.com/nicolasff/phpredis

yum search redisphp-redis.x86_64 : Extension for communicating with the Redis key-value storepython-redis.noarch : A Python client for redisredis.x86_64 : A persistent key-value database

20.4.4.3.?源碼編譯安裝

安裝git版本控制用戶端

yum install git

從github倉庫中複製一份代碼到本地

git clone git://github.com/nicolasff/phpredis.git

編譯安裝phpredis; 我暫時沒有找到 pecl的phpredis源

cd phpredisphpize./configure --with-php-config=/srv/php-5.4.9/bin/php-configmake && make install

建立設定檔

20.4.4.4.?配置 redis.ini

cat > /srv/php-5.4.9/etc/conf.d/redis.ini <

查看安裝情況

# php -m | grep redisredis

20.4.4.5.?Session 配置

使用 Redis 儲存 Session 資料

session.save_handler = redissession.save_path = "tcp://127.0.0.1:6379"或者使用多個redissession.save_path = "tcp://host1:6379?weight=1, tcp://host2:6379?weight=2&timeout=2.5, tcp://host3:6379?weight=2"

  • 聯繫我們

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