Php

Couchbase php sdk 2 一般錯誤

  • June 9, 2015

我正在嘗試使用 2.0.7 cb sdk 在 php v5.5 中測試 couchbase 連接。當我執行下面的程式碼時,我得到了以下輸出。我嘗試連接的伺服器是遠端的,我沒有在這台機器上安裝 cb 伺服器應用程序。我確實有用於 CB 的 C Lib。

[warn] event_pending: event has no event_base set.
[warn] event_add: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_add: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
[warn] event_pending: event has no event_base set.
Generic error

程式碼:

<?php
$cb = new CouchbaseCluster('couchbase://ip.add.re.ss', 'user', 'pass');
try{

   $b = $cb->openBucket('default');
}
catch( CouchbaseException $e){
   print $e->getMessage();
}

編輯:這是我為 libevent 安裝的。

# yum list | grep libevent
libcouchbase2-libevent.x86_64              2.5.0-1.el6                  @couchbase
libevent.x86_64                            1.4.13-4.el6                 @base
libevent-last.x86_64                       2.0.21-4.el6.remi            installed
libevent.i686                              1.4.13-4.el6                 base
libevent-devel.i686                        1.4.13-4.el6                 base
libevent-devel.x86_64                      1.4.13-4.el6                 base
libevent-doc.noarch                        1.4.13-4.el6                 base
libevent-headers.noarch                    1.4.13-4.el6                 base 

edit2:我在另一台幾乎相同的機器上安裝了 couchbase C sdk 和 PHP,它可以工作。

edit3:我嘗試重新安裝軟體包,但沒有任何改變。

我不得不刪除libevent-last,因為它與 couchbase 版本衝突。

couchbase 論壇上提供了更多詳細資訊。 https://forums.couchbase.com/t/lib-event-error-with-c-sdk-php/4063/2

引用自:https://serverfault.com/questions/696301