PHP SDK problem (Unable to load dynamic library)

512 weergaven
Naar het eerste ongelezen bericht

André Jacques

ongelezen,
17 apr 2015, 15:15:2017-04-2015
aan couc...@googlegroups.com
Hi,

 My setup : Debian 7.7 (Linux herpderp.ca 3.2.0-4-amd64 #1 SMP Debian 3.2.54-2 x86_64 GNU/Linux), PHP 5.4.36

 I tried to install the PHP SKD in my Debian VM, install libevent-dev, compile libcouchbase and php-couchbase too. When I try to instantiate a Couchbase class, PHP tells me it doesn't exists. Couchbase module is nowhere to be found in php -m and php -v return this error, twice :

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/couchbase.so' - libcouchbase.so.1: cannot open shared object file: No such file or directory in Unknown on line 0

 I moved my couchbase.so file in /usr/lib/php5/20100525/ and set mode without x (like all the other so file in this folder). Any idea?

A. Jacques

Mark Nunberg

ongelezen,
17 apr 2015, 15:29:5317-04-2015
aan couc...@googlegroups.com
The error indicates that it couldn’t find the libcouchbase library.

I recommend you first try to download the binary package for Debian — either your package manager, or manually. Please see here for more details http://docs.couchbase.com/developer/c-2.4/download-install.html

It seems your php extension is trying to link against libcouchbase.so.1 — which seems a bit odd considering that the soversion of the library is 2 (libcouchbase.so.2). Maybe you have a leftover from a previous install?

--
You received this message because you are subscribed to the Google Groups "Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to couchbase+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

André Jacques

ongelezen,
17 apr 2015, 15:58:4417-04-2015
aan couc...@googlegroups.com
Well, this is interesting.

I drop my couchbase.so file from PHP, because when I use locate there is no libcouchbase.so.1 to be found (as it says) : libcouchbase.so, libcouchbase.so.2 and libcouchbase.so.2.0.23 are indeed present (in /usr/lib/x86_64-linux-gnu/ and /usr/local/lib.

Do I did 

shell> wget http://packages.couchbase.com/clients/c/couchbase-csdk-setup shell> sudo perl couchbase-csdk-setup

It said at the end You should add "extension=couchbase.so" to php.ini, so in /etc/php5/mods-available, I have a couchbase.ini file, with this exact line. This file is also available in /etc/php5/apache2/conf.d/20-couchbase.ini (it's a symlink).

Here is what I get :
php -v
PHP Warning:  Module 'couchbase' already loaded in Unknown on line 0

but the surprise is :
php -m
PHP Warning:  Module 'couchbase' already loaded in Unknown on line 0
Segmentation fault

Is it possible that my libcouchbase has compilation problem?

Mark Nunberg

ongelezen,
17 apr 2015, 16:08:5017-04-2015
aan couc...@googlegroups.com
Library search paths are done first in /usr/local and then in /usr/lib. Please remove the self-compiled versions of the library. Maybe there’s a symlink somewhere, or you’re still loading an older version of the extension.

So, just to make sure everything happens with a fresh start:

  1. Remove any ‘couchbase.so’ from your PHP directories
  2. Remove your self-compiled libcouchbase (`make uninstall` might help if you still have the source tree, otherwise rm /usr/local/lib/libcouchbase* and /usr/local/include/libcouchbase/).
  3. Ensure the only libcouchbase remains is the one installed via the binary (— note, you can build from source too, but first get it working “normally”). You can check this by running the `cbc` tool, e.g. `cbc version (should tell you the version you’re using; 2.4.x) and ldd $(which cbc) should show you what it’s linked against.
  4. Finally recompile your couchbase.so module and place it in the correct directory (usually a simple ‘make install’ should do).

André Jacques

ongelezen,
20 apr 2015, 23:43:2720-04-2015
aan couc...@googlegroups.com
The situation as changed.

I created a brand new VM with Ubuntu 14.04, the Debian was way too broken to clean it up and it seems that Ubuntu community is stronger than Debian for documentation and help.

Alright, so here are the steps I followed :

1.) aptitude update && aptitude upgrade
2.) aptitude install apache2
3.) a2enmod rewrite
4.) change /etc/apache2/sites-available/000-default.conf, added the <Directory .. directive with AllowOverride All>
5.) service apache2 restart (website works)
6.) aptitude install mysql-server (connect successfully to mysql)
7.) add password for mysql-server, twice
8.) aptitude install php5 php-pear phpunit php5-cli php5-gd php5-mcrypt php5-intl php5-mysql php5-curl php5-dev
10.) apt-key add couchbase.key
11.) add, in /etc/apt/sources.list file, the couchbase repo URL
12.) aptitude update (see the couchbase link works)
13.) aptitude install libcouchbase2-core libcouchbase-dev libcouchbase2-bin libcouchbase2-libevent
14.) pecl install couchbase (works, says to add extension=couchbase.so in php.ini)
15.) create a file in /etc/php5/mods-available/couchbase.so
16.) add "extension=couchbase.so" in it
17.) create a symlink in /etc/php5/apache2/conf.d such as ln -s ../../mods-available/couchbase.ini 30-couchbase.ini
18.) reboot

Now, the page doesn't show anything, and I've got a 
[core:notice] [pid 994] AH00051: child pid xxxx exit signal Segmentation fault (11), possible coredump in /etc/apache2

I followed some thread in stackoverflow that say to use gdb. In those, it was question of a dump that could be generated to follow the tracestack php is doing. I may understand that I need a CoreDumpDirectory that is only available with apache2-mpm-itk. But I think I've misunderstood. Anyway, I installed apache2-mpm-itk, when I comment the extension=couchbase.so in /etc/php5/mods-available/couchbase.ini file, the site loads.

Oh, I forget. I've created a single PHP file with these line of codes :

$c = new CouchbaseCluster('couchbase://ip.add.re.ss:8091');
$b = $c->openBucket();
var_dump($b);
die('there');

When I've tested without the couchbase.ini mods, I replace $b with $b = ['a' => 'b'];, and it var_dump properly.
Allen beantwoorden
Auteur beantwoorden
Doorsturen
0 nieuwe berichten