Re: Linking issues on Solaris 10 x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Chris,
Thanks for your answer.

The OCI8 linking problem is a dynamic linking problem and occurs at runtime:
the path to instantclient lib 'libnnz10.so' is not linked in the oci8.so
module, while this is done for the 'libclntsh.so'. So at runtime the
libnnz10.so cannot be found.

This is what we get, when not tweaking the Makefile:

# /opt/app/damp/php/bin/php
PHP Warning:  PHP Startup: Unable to load dynamic library
'/opt/app/damp/php/lib/php/extensions/no-debug-zts-20060613/oci8.so' -
ld.so.1: php: fatal: libnnz10.so: open failed: No such file or directory in
Unknown on line 0

And when listing the dynamic dependencies of the oci8.so I get this output:
# ldd oci8.so 
    libclntsh.so.10.1 =>
/opt/app/damp/instantclient_10_2/libclntsh.so.10.1
    libnnz10.so =>     (file not found)
    ....

When I tweak the makefile and recompile it I get this output for
# ldd oci8.s0
    libclntsh.so.10.1 =>
/opt/app/damp/instantclient_10_2/libclntsh.so.10.1
    libnnz10.so =>     /opt/app/damp/instantclient_10_2/libnnz10.so
    ....
And php can be started at the cli without any problems (all libs found).
This is how it should be in my opinion.

There is a "solution" at the Oracle website, but I don't like it at all.
See http://www.oracle.com/technology/pub/notes/technote_php_instant.html
Here they propose to edit the LD_LIBRARY_PATH of the apache server. It was
written for linux, so it seems that they face the same problem.
IMHO editing LD_LIBRARY_PATH should be avoided if possible (see
http://blogs.sun.com/ali/entry/avoiding_ld_library_path_the). It is much
cleaner to link in the runtime path to the library as is already done for
the libclntsh.so.

I've already tried using the latest OCI8 PECL (version 1.4.1) module, but I
encounter the same problem.
I haven't tried it with instantclient_11_2 yet, but we still use oracle 10.

Regards,
Kristof.

On 12/07/10 19:27, "Christopher Jones" <christopher.jones@xxxxxxxxxx> wrote:

> 
> Hi Kristof,
> 
> Regarding the OCI8 side of the question, it could be something Solaris
> specific with linking or it might be a function of the way that the
> version of Instant Client was built on Solaris.
> 
> Can you retry with Instant Client 11.2?  I recall at some point of
> Instant Client's history there was an rpath change on Linux.  I'm not
> a Solaris user.
> 
> For discoverability and tracking can you log a bug at
> http://bugs.php.net/ ?  Include the full Instant Client version and
> also do a diff -u Makefile.orig Makefile.
> 
> Unrelated to your issue, for PHP 5.2 I'd recommend using the version
> of PHP OCI8 from PECL.
> 
> Chris
> 
> 
> On 07/12/2010 04:04 AM, Kristof Van Damme wrote:
>> Hi all,
>> I am building PHP 5.2.13 on Solaris 10 u8 x86 using Sun Studio 12 u1.
>> I want to install php and all dependant libraries (for the php extensions)
>> in ${INSTALLDIR}. This is not a default library location, so I want all
>> paths to the libs to be compiled in.
>> I succeed in compiling it, but it needed a few tweaks and 'make test' fails
>> more than I want to.
>> The modules that needed some tweaks are 'gd'  and 'oci8' with oracle
>> instantclient 10.2.
>> 
>> Here is my configure string and tweak for oci8 with instantclient:
>> # CC="/usr/bin/cc" CFLAGS="-xO4 -xtarget=generic" EXTRA_LIBS="-liconv"
>> ../configure --prefix=${INSTALLDIR}/php
>> --with-config-file-path=${INSTALLDIR}/php --disable-cgi
>> --with-apxs2=${INSTALLDIR}/apache2/bin/apxs --with-zlib --with-bz2=shared
>> --without-sqlite --without-pgsql
>> --with-oci8=shared,instantclient,${INSTALLDIR}/instantclient_10_2
>> --with-mysql=shared,${INSTALLDIR}
>> --with-mysqli=shared,${INSTALLDIR}/bin/mysql_config
>> --with-pdo-mysql=shared,${INSTALLDIR} --with-libxml-dir=shared,${INSTALLDIR}
>> --with-xsl=shared,${INSTALLDIR} --with-gd --enable-exif
>> --enable-gd-native-ttf --with-jpeg-dir=${INSTALLDIR}
>> --with-png-dir=${INSTALLDIR} --with-t1lib=${INSTALLDIR}
>> --with-freetype-dir=${INSTALLDIR} --enable-calendar --enable-mbstring
>> --enable-sockets --enable-wddx --enable-zip --with-iconv-dir=${INSTALLDIR}
>> --with-ldap=shared,${INSTALLDIR} --with-mcrypt=shared,${INSTALLDIR}
>> --with-openssl=shared,${INSTALLDIR} --with-curl=shared,${INSTALLDIR}
>> --with-tidy=shared,${INSTALLDIR}
>> # cp Makefile Makefile.orig
>> # sed -e 's/^OCI8_SHARED_LIBADD.*/&  -lnnz10/' Makefile.orig>  Makefile
>> 
>> We use the oracle instantclient 10.2 for OCI8. At linking the nnz10 library
>> was neglected for some reason.
>> So I had to add it manually to the Makefile.
>> The EXTRA_LIBS variable was needed because the gd library requires iconv,
>> but the linker did not link to it.
>> 
>> Compilation succeeds, but 'make test' fails.
>> 
>> Can someone shed some light on these issues?  Should these be considered
>> (minor) bugs?
>> 
>> Thanks in advance.




[Index of Archives]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [Postgresql]     [PHP Books]     [PHP Databases]     [PHP SOAP]
  Powered by Linux