Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 1.8.x

Problem using CouchBase PHP SDK from Apache (shell is working fine)

3 replies [Last post]
  • Login or register to post comments
Tue, 11/06/2012 - 00:35
tonymelony
Offline
Joined: 11/06/2012
Groups: None

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 ;-)

Top
  • Login or register to post comments
Tue, 11/06/2012 - 13:07
mikew
Offline
Joined: 03/14/2011
Groups:

You probably didn't properly set up your extension properly. Make sure that you have added the following in your php.ini file.

extension=/path/to/couchbase.so

The look at the output of "php -i" and make sure your extension was loaded properly.

Top
  • Login or register to post comments
Wed, 11/07/2012 - 23:30
tonymelony
Offline
Joined: 11/06/2012
Groups: None

The extension seems to be fine for PHP:
shell> php -i
Gives me:

couchbase
 
couchbase support => enabled
version => 1.0.5
json support => yes
fastlz support => no
zlib support => yes
 
Directive => Local Value => Master Value
couchbase.compression_factor => 1.3 => 1.3
couchbase.compression_threshold => 2000 => 2000
couchbase.compressor => none => none
couchbase.serializer => php => php

Running phpinfo(); within a php file and loading it from an external browser will give the same results.

Top
  • Login or register to post comments
Wed, 01/16/2013 - 06:12
kcjl519
Offline
Joined: 01/15/2013
Groups: None

I have the same problem on CentOS 6.2

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker