Problem using CouchBase PHP SDK from Apache (shell is working fine)
I installed couchbase on Centos 6.3 x86 with the PHP SDK. I used the php demopage below to test the installation.
<?php $cb = new Couchbase("localhost:8091"); $cb->set("a", 1); var_dump($cb->get("a")); ?>
Everything is working fine when calling the php script from shell.
shell> php /var/www/html/couchbasetest.php int(1)
But running under apache it will give me the following error.
Warning: Couchbase::__construct(): Failed to connect libcouchbase to server: Connection failure in /var/www/html/couchbasetest.php on line 7 Warning: Couchbase::set(): unintilized couchbase in /var/www/html/couchbasetest.php on line 8 Warning: Couchbase::get(): unintilized couchbase in /var/www/html/couchbasetest.php on line 9 bool(false)
I tried to solve the issue by giving a username, password and bucketname in code but that didn't help me either.
How can I solve this problem? It seems like a kind of security issue. I am not a Linux geek so that could be the problem too ;-)