[ Christine Ross ]
> My server is Solaris 10 Sparc and Iâm using Suns cc compilers.
>
> I have curl compiled into /usr/local/lib and compiled again native
> Solaris 10 openssl. I installed another version into
> /usr/local/curl-7.19.5 and compiled against a different openssl.
> Then I compiled php using that later curl verion (see below). Today
> I did an ldd against php shows it is using /usr/local/lib. I donât
> believe I specify the lib directory on the php --with-curl line.
> Doesnât my LD_RUN_PATH specify where to find the library files? Both
> versions are 7.19.5 but I need one compiled against the native
> libraries.
>
> What is even stranger is that if I run php âi it will show php
> compiled against the 2^nd curl installation (libcurl/7.19.5
> OpenSSL/0.9.8h zlib/1.2.3) but phpinfo on a web browser shows the
> curl info from /usr/local/lib (libcurl/7.19.5 OpenSSL/0.9.7d
> zlib/1.2.3).
Do an 'ldd' on the PHP binary using the same (clean) shell environment
you use when starting Apache, making sure you have no LD_* variables
set in your env. Does it still come up with the "libcurl/7.19.5"-path?
> Why isnât php compiling against the correct curl?
>
> Thanks for any help.
>
> # ldd /usr/local/bin/php | grep curl
> libcurl.so.4 => /usr/local/lib/libcurl.so.4
> #
This tells you which library the binary has linked to, i.e. which
RUN_PATH the binary is built with. You can override this using things
like LD_LIBRARY_PATH in your shell environment, but it doesn't change
the RUN_PATH in the binary.
> # more ConfigurePHP
> #!/bin/sh
>
> PATH=/opt/SUNWspro/bin:/usr/local/bin:/usr/bin:/usr/ccs/bin:/usr/sfw/bin:/usr/dt/bin:/usr/openwin/
> bin:/usr/sbin; export PATH
> LD_RUN_PATH=/usr/local/curl-7.19.5/lib:/usr/sfw/lib:/usr/local/lib; export LD_RUN_PATH
Try adding CFLAGS including your curl to your build, e.g.
CFLAGS='-L/usr/local/curl-7.19.5/lib -R/usr/local/curl-7.19.5/lib'; export CFLAGS
I've used it with success before on both Solaris8 and 10 (sparc,
SunCC) to get a proper RUN_PATH in the binary.
Failing all else, you might try use a nifty little tool called
'chrpath' to brute-force a new RPATH in your binary:
http://linux.die.net/man/1/chrpath
Caveat: I've only used it on linux x86; don't know if it'll work on SPARC.
~ksvee
[Index of Archives]
[PHP Users]
[PHP Home]
[PHP on Windows]
[Kernel Newbies]
[PHP Classes]
[Postgresql]
[PHP Books]
[PHP Databases]
[PHP SOAP]