Failed to execute view in php-ext-module
Fri, 08/24/2012 - 16:37
When I try to execute a view with php extension (1.1dp3) i get the following error:
Couchbase::view() [couchbase.view]: Failed to execute view: Protocol error in ....
The php code look like:
<?php
$cb = new Couchbase("127.0.0.1:8091", "root", "metallica324", "default");
$result = $cb->view("_all_docs", "view_name?include_docs=true");
foreach($result["rows"] as $row) {
echo $row->key;
}
Thnx!
Hello CriztianiX,
two things here:
- First, you don't want to mix _all_docs and a custom view name. If you want to include the actual docs for the _all_docs query, use it this way: $cb->view("_all-docs", "?include_docs=true");
- Second, in dp3 the view support is only half-baked (only _all_docs works). I've recently pushed a fix for this to GitHub, but you'll want to wait for dp4 which includes it. If you're curious and want to walk "on the wild side", you can clone the master repository (https://github.com/couchbase/php-ext-couchbase) and compile it for yourself (phpize; ./configure; make && sudo make install).
If you have any further questions, don't hesitate to ask.
Best,
Michael