You are not logged in.

#1 2013-02-10 17:27:53

meekong
Member
Registered: 2013-02-10
Posts: 9

[SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

Hi guys,

I'm trying to create an AUR package for Valentina DB php extension called vphp.
It's not available for Arch so i decided to create my own package.

# Maintainer: Sam Van der Borght <sam@king-foo.be>
pkgname=valentina-vphp54-beta
pkgver=current
pkgrel=2
pkgdesc="Valentina database PHP 5.4 extension, required for connecting to valentina databases through PHP"
arch=('x86_64')
url="http://www.valentina-db.com/download/beta/"
license=('unknown')
makedepends=('rpmextract')
options=('emptydirs')
#source=("http://www.valentina-db.com/download/beta/5.0b66/linux_64/vphp54_x64_5_lin.rpm")
#md5sums=('5c7a891ea957e60562e4ab70dfd0ccde')
source=("http://www.valentina-db.com/download/beta/5.0b66/linux_64/vphp54_standalone_x64_5_lin.rpm")
md5sums=('b209779516c64e413fd19559083c7588')
#source=("http://www.valentina-db.com/download/beta/5.0b65/linux_32/vphp53_standalone_5_lin.rpm")
#md5sums=('a236f59563e85b5a0ba3514fdd42cb41')

build() {
  cd "$pkgdir"
  rpmextract.sh ../vphp54_standalone_x64_5_lin.rpm
  echo "Create a file valentina.ini in your PHP config dir (eg. /etc/php/conf.d/)."
  echo "Add the following line to it: extension=/opt/VPHP_Standalone54/php54_valentina_standalone.so"
}

Everything goes well, package can be installed and i can find the .so file in /opt/VPHP_Standalone54/ folder.
I added the extension to php.ini using an external config file (valentina.ini -> extension=/opt/VPHP_Standalone54/php54_valentina_standalone.so).

phpinfo() shows the file is being parsed but im getting the following error when trying to use it:

PHP Warning:  PHP Startup: Unable to load dynamic library '/opt/VPHP_Standalone54/php54_valentina_standalone.so' - libvshared_release_x64.so.500: cannot open shared object file: No such file or directory in Unknown on line 0

I have spent hours trying to figure out how i can solve this problem but i failed.

Please help me figure this out.. Thanks smile

Last edited by meekong (2013-02-11 19:08:54)

Offline

#2 2013-02-10 17:39:22

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

Does your package install that libvshared_release_x64.so.500 file?
If it does it might help adding the containing folder in an /etc/ld.so.conf.d/* script.
If not, then, well, it's missing.

Last edited by teekay (2013-02-10 17:53:08)

Offline

#3 2013-02-10 17:46:07

meekong
Member
Registered: 2013-02-10
Posts: 9

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

Hi,

Yes the package installs those files to the opt folder:

$ls -la /opt/VPHP_Standalone54/vcomponents          
                                                                                                                 ─┘
total 56008
drwxr-xr-x 3 root root     4096 Feb 10 17:21 ./
drwxr-xr-x 4 root root     4096 Feb 10 17:21 ../
-rwxr-xr-x 1 root root    20264 Feb 10 17:21 libdns_sd.so*
-rwxr-xr-x 1 root root 18277240 Feb 10 17:21 libicudata.so.48*
-rwxr-xr-x 1 root root  2183192 Feb 10 17:21 libicui18n.so.48*
-rwxr-xr-x 1 root root    52432 Feb 10 17:21 libicuio.so.48*
-rwxr-xr-x 1 root root  1589528 Feb 10 17:21 libicuuc.so.48*
lrwxrwxrwx 1 root root       17 Feb  5 16:48 libjpeg.so -> libjpeg.so.62.0.0
lrwxrwxrwx 1 root root       17 Feb  5 16:48 libjpeg.so.62 -> libjpeg.so.62.0.0
-rw-r--r-- 1 root root   143496 Feb 10 17:21 libjpeg.so.62.0.0
lrwxrwxrwx 1 root root       16 Feb  5 16:48 libtiff.so -> libtiff.so.4.2.1
lrwxrwxrwx 1 root root       16 Feb  5 16:48 libtiff.so.4 -> libtiff.so.4.2.1
-rw-r--r-- 1 root root   367064 Feb 10 17:21 libtiff.so.4.2.1
lrwxrwxrwx 1 root root       29 Feb  5 16:48 libvclient_release_x64.so -> libvclient_release_x64.so.500*
-rwxr-xr-x 1 root root  5292288 Feb 10 17:21 libvclient_release_x64.so.500*
lrwxrwxrwx 1 root root       29 Feb  5 16:48 libvkernel_release_x64.so -> libvkernel_release_x64.so.500*
-rwxr-xr-x 1 root root 19054264 Feb 10 17:21 libvkernel_release_x64.so.500*
lrwxrwxrwx 1 root root       29 Feb  5 16:48 libvreport_release_x64.so -> libvreport_release_x64.so.500*
-rwxr-xr-x 1 root root  7777168 Feb 10 17:21 libvreport_release_x64.so.500*
lrwxrwxrwx 1 root root       29 Feb  5 16:48 libvshared_release_x64.so -> libvshared_release_x64.so.500*
-rwxr-xr-x 1 root root  2462760 Feb 10 17:21 libvshared_release_x64.so.500*
lrwxrwxrwx 1 root root       15 Feb  5 16:48 libz.so -> libz.so.1.2.3.3
lrwxrwxrwx 1 root root       15 Feb  5 16:48 libz.so.1 -> libz.so.1.2.3.3
-rw-r--r-- 1 root root    93536 Feb 10 17:21 libz.so.1.2.3.3
drwxrwxr-x 5 root root     4096 Nov 16 12:55 vresources/

The .500 file seems to be the real file and the others a symlink to this file.
I added valentina.conf to /etc/ld.so.conf.d/ and put /opt/VPHP54_Standalone54/vcomponents in it and restarted httpd.
However im still getting this error. Whats wrong with this file?

Offline

#4 2013-02-10 17:55:54

meekong
Member
Registered: 2013-02-10
Posts: 9

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

I forgot to reload the ld config

sudo ldconfig -f /etc/ld.so.conf

Now im getting:
php: /opt/VPHP_Standalone54/vcomponents/libz.so.1: version `ZLIB_1.2.3.3' not found (required by /usr/lib/libxml2.so.2)

I got zlib installed but at version: 1.2.7-1

Offline

#5 2013-02-10 18:05:40

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

Did you run ldconfig afterwards?

Another solution would be to install the libs to /usr/lib, of course. Just make sure to delete the libz.so*, libtiff and libjepg stuff and pray it works with the system ones.


EDIT: boy I'm slow today.
Anyways, looking at their DEB file's postinst control file, they move stuff to /usr/local/lib.

Try deleting the libz.so* they ship there, it seems to mess up your libxml2!

Last edited by teekay (2013-02-10 18:10:01)

Offline

#6 2013-02-10 18:13:30

meekong
Member
Registered: 2013-02-10
Posts: 9

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

How did you extract the .deb file correctly to find the postinst files on Arch?

Offline

#7 2013-02-10 18:16:20

meekong
Member
Registered: 2013-02-10
Posts: 9

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

Nevermind, found it smile
ar xv package.deb

 ldconfig -p | grep libz                                                          ─┘
        libz.so.1 (libc6,x86-64) => /opt/VPHP_Standalone54/vcomponents/libz.so.1
        libz.so.1 (libc6,x86-64) => /usr/lib/libz.so.1
        libz.so.1 (libc6) => /usr/lib32/libz.so.1
        libz.so (libc6,x86-64) => /usr/lib/libz.so

This is the current output of ldconfig btw!

Offline

#8 2013-02-10 18:30:23

meekong
Member
Registered: 2013-02-10
Posts: 9

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

I deleted all libz's

 ldconfig -p | grep libz                                                        ─┘
        libz.so.1 (libc6,x86-64) => /usr/local/lib/libz.so.1

and in /usr/local/lib are the files from the vcomponents folder. I created a symlink for libz.so.1 to libz.so.1 -> libz.so.1.2.3.3

It's still complaining about the files hmm

Last edited by meekong (2013-02-10 18:30:43)

Offline

#9 2013-02-10 18:30:27

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

Yes, and that's bad. See

ldd /usr/lib/libxml2.so.2

and the output you posted:
"php: /opt/VPHP_Standalone54/vcomponents/libz.so.1: version `ZLIB_1.2.3.3' not found (required by /usr/lib/libxml2.so.2)"

This means you have a broken libz.so.1 in your ld.so cache => bad! Delete the /opt/VPHP_Standalone54/vcomponents/libz.so.1 and re-run ldconfig. Don't logout or do anything else before you're done with that smile

Offline

#10 2013-02-10 18:40:35

meekong
Member
Registered: 2013-02-10
Posts: 9

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

ldd /usr/lib/libxml2.so.2                                                        ─┘
/usr/lib/libxml2.so.2: /opt/VPHP_Standalone54/vcomponents/libz.so.1: version `ZLIB_1.2.3.3' not found (required by /usr/lib/libxml2.so.2)
        linux-vdso.so.1 (0x00007fffcef58000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f80a2197000)
        libz.so.1 => /opt/VPHP_Standalone54/vcomponents/libz.so.1 (0x00007f80a1f80000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f80a1d5d000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007f80a1a5e000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007f80a16b1000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007f80a270a000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f80a1495000)
ls -la vcomponents/libz*                                                       ─┘
lrwxrwxrwx 1 root root    15 Feb  5 16:48 vcomponents/libz.so -> libz.so.1.2.3.3
lrwxrwxrwx 1 root root    15 Feb  5 16:48 vcomponents/libz.so.1 -> libz.so.1.2.3.3
-rw-r--r-- 1 root root 93536 Feb 10 17:21 vcomponents/libz.so.1.2.3.3

I cleared all the other libraries, however it still wont take the right one.
Any idea how to force this?

Thanks for all your help, could of gotten this far without you smile

Offline

#11 2013-02-10 18:53:10

meekong
Member
Registered: 2013-02-10
Posts: 9

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

ldconfig -p | grep libz                                                        ─┘
        libz.so.1 (libc6,x86-64) => /opt/VPHP_Standalone54/vcomponents/libz.so.1
        libz.so.1 (libc6,x86-64) => /usr/lib/libz.so.1
        libz.so (libc6,x86-64) => /opt/VPHP_Standalone54/vcomponents/libz.so
        libz.so (libc6,x86-64) => /usr/lib/libz.so
ldd /usr/lib/libxml2.so.2                                                        ─┘
/usr/lib/libxml2.so.2: /opt/VPHP_Standalone54/vcomponents/libz.so.1: version `ZLIB_1.2.3.3' not found (required by /usr/lib/libxml2.so.2)
        linux-vdso.so.1 (0x00007fffcf3b3000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007ff0ebf85000)
        libz.so.1 => /opt/VPHP_Standalone54/vcomponents/libz.so.1 (0x00007ff0ebd6e000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007ff0ebb4b000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007ff0eb84c000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007ff0eb49f000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007ff0ec4f8000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007ff0eb283000)

So basicly libxml2 wants the version in /usr/lib which is higher than the one in VPHP package.
How can i tell libxml to use that version and the ldd php54_valentina_standalone.so to take the version in /opt/VPHP/vcomponents?

Offline

#12 2013-02-10 18:56:26

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

You need to get rid of /opt/VPHP_Standalone54/vcomponents/libz.so.1 completely. It's not really needed.

Let's play with data.tar.bz2 from the DEB. First get rid of libs we do get from Arch directly

└» tar xf ../data.tar.bz2
└» rm -f ./opt/VPHP_Standalone54/vcomponents/libz.so*
└» rm -f ./opt/VPHP_Standalone54/vcomponents/libjpeg.so*
└» rm -f ./opt/VPHP_Standalone54/vcomponents/libdns_sd.so
└» LD_LIBRARY_PATH=./opt/VPHP_Standalone54/vcomponents ldd ./opt/VPHP_Standalone54/php54_valentina_standalone.so 
        linux-vdso.so.1 (0x00007fffc25ff000)
        libvshared_release_x64.so.500 => ./opt/VPHP_Standalone54/vcomponents/libvshared_release_x64.so.500 (0x00007fd9e16e9000)
        libvclient_release_x64.so.500 => ./opt/VPHP_Standalone54/vcomponents/libvclient_release_x64.so.500 (0x00007fd9e0fde000)
        libvkernel_release_x64.so.500 => ./opt/VPHP_Standalone54/vcomponents/libvkernel_release_x64.so.500 (0x00007fd9dfbb3000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fd9df86e000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007fd9df570000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fd9df35a000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007fd9defad000)
        libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fd9deda9000)
        libtiff.so.4 => ./opt/VPHP_Standalone54/vcomponents/libtiff.so.4 (0x00007fd9deb4e000)
        libpng12.so.0 => /usr/lib/libpng12.so.0 (0x00007fd9de924000)
        libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fd9de708000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007fd9de4f1000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x00007fd9de2a0000)
        librt.so.1 => /usr/lib/librt.so.1 (0x00007fd9de098000)
        libdns_sd.so => /usr/lib/libdns_sd.so (0x00007fd9dde8e000)
        libicudata.so.48 => ./opt/VPHP_Standalone54/vcomponents/libicudata.so.48 (0x00007fd9dcb1f000)
        libicui18n.so.48 => ./opt/VPHP_Standalone54/vcomponents/libicui18n.so.48 (0x00007fd9dc70a000)
        libicuio.so.48 => ./opt/VPHP_Standalone54/vcomponents/libicuio.so.48 (0x00007fd9dc4fd000)
        libicuuc.so.48 => ./opt/VPHP_Standalone54/vcomponents/libicuuc.so.48 (0x00007fd9dc178000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007fd9e1d65000)
        libavahi-client.so.3 => /usr/lib/libavahi-client.so.3 (0x00007fd9dbf66000)
        libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x00007fd9dbd20000)
        libavahi-common.so.3 => /usr/lib/libavahi-common.so.3 (0x00007fd9dbb13000)

Looks good.
Now it also ships an old libtiff.so.4* and libs from an old icu 4.8. Remove at least the libtiff.so symlink

└» rm -f ./opt/VPHP_Standalone54/vcomponents/libtiff.so

The libicu*.48 stuff shouldn't really hurt, you can install those.

Last edited by teekay (2013-02-10 18:57:52)

Offline

#13 2013-02-10 19:20:04

meekong
Member
Registered: 2013-02-10
Posts: 9

Re: [SOLVED]PHP extension: cannot load shared object. Created AUR from rpm

Wow,

I can only thank you so much!
You nailed it on the deleting part. Turns out vphp so file works great with the already provided libz.
I deleted all the stuff manually like you said and it works like a charm.

Now i need to figure out how to let PKGBUILD do it for me and run ldconfig after installing it with pacman

thanks!

Offline

Board footer

Powered by FluxBB