我编译库的couchbase为php7:https://github.com/couchbase/php-couchbase/tree/php7。 当我尝试进行操作时(upsert),我有一个错误。与couchbase sdk2 Php7尝试在couchbase中插入值时返回警告
$cluster = new CouchbaseCluster('127.0.0.1', "user", "password");
$db = $cluster->openBucket('default');
$db->upsert('testdoc', ['name' =>'Frank']);
PHP Warning: Invalid callback , no array or string given in Unknown on line 0
PHP Stack trace:
PHP 1. {main}() php shell code:0
PHP 2. CouchbaseBucket->upsert() php shell code:1
PHP 3. _CouchbaseBucket->upsert() [CouchbaseNative]/CouchbaseBucket.class.php:134
PHP Warning: Invalid callback , no array or string given in Unknown on line 0
PHP Stack trace:
PHP 1. {main}() php shell code:0
PHP 2. CouchbaseBucket->upsert() php shell code:1
PHP 3. _CouchbaseBucket->upsert() [CouchbaseNative]/CouchbaseBucket.class.php:134
如果我尝试
$db->upsert('testdoc', 'Frank');
或
$db->upsert('testdoc', json_encode(['key' => 'Frank']));
产生相同的警告,并在couchbase该键(testdoc)插入一个空字符串。如何解决这个错误?
哪个OS /体系结构和哪个特定的PHP版本? –