乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      安裝php redis擴(kuò)展 - 傻瓜式微信開發(fā)教程23

       取經(jīng)悟能 2015-10-10
      通過api獲取的access_token是有時(shí)效的,
      目前在7200秒內(nèi)有效,
      獲取access_token的api調(diào)用是有次數(shù)限制的,
      我們之前為了方便,每次都會(huì)重新獲取,
      但是這種方式在正式的開發(fā)中是不行的.

      現(xiàn)在我們持久化access_token,也就是把a(bǔ)ccess_token存起來,在有效期內(nèi)不調(diào)用api重新獲取.
      持久化的方式有很多,文本,mysql,memcached,redis等.
      這里我們選擇了redis.

      一. 首先我們介紹一下怎么在centos上安裝redis服務(wù).

      1、檢查安裝依賴程序

      1. yum install gcc-c++
      2. yum install -y tcl
      3. yum install wget
      復(fù)制代碼

      2、獲取安裝文件
      游客,如果您要查看本帖隱藏內(nèi)容請回復(fù)

      3、解壓文件

      1. tar -xzvf redis-2.8.19.tar.gz
      2. mv redis-2.8.19 /usr/local/redis
      復(fù)制代碼

      4、進(jìn)入目錄

      1. cd /usr/local/redis
      復(fù)制代碼

      5、編譯安裝

      1. make
      2. make install
      復(fù)制代碼

      6、設(shè)置配置文件路徑

      1. mkdir -p /etc/redis
      2. cp redis.conf/etc/redis
      復(fù)制代碼

      7、修改配置文件

      1. vi /etc/redis/redis.conf
      復(fù)制代碼

      僅修改: daemonize yes (no-->yes)
      8、啟動(dòng)

      1. /usr/local/bin/redis-server /etc/redis/redis.conf
      復(fù)制代碼

      9、查看啟動(dòng)

      1. ps -ef | grep redis
      復(fù)制代碼

      10、使用客戶端

      1. redis-cli
      2. >set name david
      3. OK
      4. >get name
      5. "david"
      復(fù)制代碼

      11.關(guān)閉客戶端

      1. redis-cli shutdown
      復(fù)制代碼

      12、開機(jī)啟動(dòng)配置

      1. echo "/usr/local/bin/redis-server /etc/redis/redis.conf &" >> /etc/rc.local
      復(fù)制代碼

      開機(jī)啟動(dòng)要配置在 rc.local 中,而 /etc/profile 文件,要有用戶登錄了,才會(huì)被執(zhí)行。

      二. 安裝PHP的redis擴(kuò)展.

      1. 安裝依賴庫編譯phpredis

      1. yum install php-devel
      復(fù)制代碼

      然后編譯安裝phpredis:
      游客,如果您要查看本帖隱藏內(nèi)容請回復(fù)

      2. 查看安裝結(jié)果

      Installing shared extensions:     /usr/lib64/php/modules/
      執(zhí)行:ls  /usr/lib64/php/modules/  | grep redis
      顯示有:redis.so

      3. 更改配置文件php.ini啟用redis php擴(kuò)展

      //開啟redis擴(kuò)展
      extension=redis.so

      以上步驟完成后,我們查看phpinfo()頁面,如果能看到'redis'區(qū)段,證明擴(kuò)展安裝成功
       


        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約

        類似文章 更多