Linux 上安裝Gearman及其PHP擴充

來源:互聯網
上載者:User

標籤:

安裝Gearman服務端

  1. # yum install -y uuid-devel libuuid libuuid-devel uuid boost-devel libevent libevent-devel gperf
  2. # wget https://launchpad.net/gearmand/1.2/1.1.7/+download/gearmand-1.1.7.tar.gz
  3. # tar zxvf gearmand-1.1.7.tar.gz
  4. # cd gearmand-1.1.7
  5. # ./configure --prefix=/usr/local/server/gearmand-1.1.7
  6. # make && make install
  7. # ln -s /usr/local/server/gearmand-1.1.7 /usr/local/server/gearmand

啟動Gearman服務端:

# /usr/local/server/gearmand-1.1.7/sbin/gearmand -d

  • -b,--backlog= 儲備的監聽串連數量
  • -d, --daemon 後台運行
  • -f, --file-descriptors= 檔案描述符的數量
  • -h, --help 協助
  • -j, --job-retries= 在ob server移除不可用job之前啟動並執行次數,防止不斷運行導致其他可用worker崩潰。預設沒有限制
  • -l, -log-file= 記錄檔存放位置(預設記錄最簡單日誌)
  • -L, --listen= 監聽的IP,預設全部接受
  • -p, --port= 指定監聽連接埠
  • -P, --pid-file= 指定進程ID寫入位置
  • -r, --protocol= 載入協議模組
  • -q, --queue-type= 指定持久化隊列
  • -t, --threads= 使用的I/9線程數量。預設為0
  • -u, --user= 啟動後,切換到指定使用者
  • -v, --verbose 增加一級詳細程度
  • -V, --version 顯示版本資訊

出現Could not open log file這種錯誤,需要使用--log-file指定記錄檔

安裝PHP擴充

  1. # wget http://pecl.php.net/get/gearman-1.1.1.tgz
  2. # tar zxvf gearman-1.1.1.tgz
  3. # cd gearman-1.1.1
  4. # /usr/local/server/php/bin/phpize
  5. # ./configure --with-php-config=/usr/local/server/php/bin/php-config --with-gearman=/usr/local/server/gearmand-1.1.7/
  6. # make && make install

上述步驟會輸出擴充安裝目錄:/usr/local/server/php-5.4.14/lib/php/extensions/no-debug-non-zts-20100525/
修改php.ini,以下加入語句加入:
extension=/usr/local/server/php-5.4.14/lib/php/extensions/no-debug-non-zts-20100525/gearman.so

重啟php-fpm,用phpinfo查看是否安裝成功
# service php-fpm restart

 

Note:

安裝PHP擴充時候,有可能因為版本問題導致安裝失敗。所以最好去官網看下最新版本。

    • Gearman官網下載:http://gearman.org/download
    • PHP驅動下載:http://pecl.php.net/package/gearman

 

轉自:http://www.williamsang.com/archives/966.html

Linux 上安裝Gearman及其PHP擴充

聯繫我們

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