RE: why does php compile looks for wrong curl

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



Thank you for the ideas.  I was able to get the correct LDD after setting ldflags and ld_library_path.  




-----Original Message-----
From: Kenneth Svee [mailto:k.s.svee@xxxxxxxxxxx]
Sent: Fri 11/5/2010 6:25 AM
To: php-install@xxxxxxxxxxxxx
Subject: Re:  why does php compile looks for wrong curl
 
[ 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

<<winmail.dat>>


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