Current setup:
Docker image with: Version: 4.5.0-2601 Enterprise Edition (build-2601)
php.ini:
PHP Version 5.6.23
couchbase
couchbase support enabled
extension version 2.2.0
libcouchbase runtime version 2.6.1 (git: eb09707433013b742c0aa221e564ad73ba8a3708)
libcouchbase headers version 2.6.1 (git: eb09707433013b742c0aa221e564ad73ba8a3708)
When running the example hello-couchbase.php provided in http://developer.couchbase.com/documentation/server/current/sdk/php/start-using-sdk.html
It runs ok until the N1QL query, then it throws an exception:
CouchbaseException in CouchbaseBucket.class.php line 316:
LCB_EINVAL: Invalid input/arguments
in CouchbaseBucket.class.php line 316
at _CouchbaseBucket->n1ql_request('{"statement":"SELECT * FROM `default` WHERE $p IN interests"}', true) in CouchbaseBucket.class.php line 316
at CouchbaseBucket->_n1ql(object(CouchbaseN1qlQuery), array('p' => 'African Swallows')) in CouchbaseBucket.class.php line 378
(...)
Code:
// Query with parameters
$query = CouchbaseN1qlQuery::fromString("SELECT * FROM `default` WHERE \$p IN interests");
echo "Parameterized query:\n";
var_dump($query);
$rows = $bucket->query($query, array("p" => "African Swallows"));
echo "Results:\n";
var_dump($rows);
The same query on the web interface, runs perfectly:
[
{
"default": {
"email": "kingarthur@couchbase.com",
"interests": [
"African Swallows",
"PHP 7"
]
}
}
]
Am I missing anything here?