Click to See Complete Forum and Search --> : Curl, OpenSSL, Apache, Solaris 9 barfing


Colin_White
07-26-2003, 09:53 AM
<< PHP4.3.2 | Curl 7.9.8 | OpenSSL 0.9.7b | Apache1.3.27 | Solaris 9 (Sparc) | Openldap | Mysql >>

I have to re-build my PHP to include Curl support.

Curl seems to work fine from the Solaris command line thanks to SFWcurl from the Solaris Companion Freeware CD (or from Sun downloads) which installs to /opt/sfw. Anyone know for sure if this SFWcurl PKG includes SSL support?

PHP appears to build successfully with Curl using -
> ./configure --with-apxs=/usr/local/apache/bin/apxs
--with-zlib=/usr
--with-mysql=/usr/local/mysql
--with-ldap=/usr/local/openldap
--with-ssl=/usr/local/ssl
--with-curl=/opt/sfw
--with-netbpm=/usr/local/netbpm
> make
> make install
> cp php.ini-dist /usr/local/lib/php.ini


When I come to restart Apache and SSL with -
> apachectl stop
> apachectl startssl


It barfs with -
Syntax error on line 24 of /usr/local/apacheSSL/conf/httpd.conf:
Cannot load /usr/local/apacheSSL/libexec/libphp4.so into server: ld.so.1: /usr/local/apacheSSL/bin/httpd: fatal: relocation error: file /opt/sfw/lib/libcurl.so.2: symbol __floatdidf: referenced symbol not found /usr/local/apacheSSL/bin/apachectl startssl: httpd could not be started

Googling Grps for this suggests I'm incorrectly setting paths to libs... sound sane? How do I do this? In my .cshrc prior to building? Or does this need to be system wide? Or at ./configure time?

Any help much appreciated.

Thx

tsinka
07-26-2003, 02:57 PM
Hi,

it should be sufficient to set the LD_LIBRARY_PATH environment variable in your .cshrc , e.g.

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/sfw/lib:/opt/sfw/lib

Or you can set it in the apache startup script.

Thomas

tsinka
07-26-2003, 03:01 PM
The correct syntax:

setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:/usr/sfw/lib:/opt/sfw/lib

tsinka
07-26-2003, 03:04 PM
Hi,

might be a little bit more complicated, read this thread, especially the last post:

http://bugs.php.net/bug.php?id=16826

Colin_White
07-26-2003, 03:21 PM
I also found this -

http://bugs.php.net/bug.php?id=16826

Particularly the last entry.

I also seem to have more success with compiling the latest cURL source, rather than Suns SFWcurl package.

Many Thanks.

Colin_White
07-27-2003, 08:59 AM
When building Openssl for use with Curl and PHP, be sure to specify shared libs with -

> ./config shared

Without this, Curl will not complain during build, but cause PHP to barf when Apache loads it at the very last step! So...

(1) Make sure OpenSSL is compiled with shared libs!

(2) Check your Curl is working with SSL...
> curl-config --libs
The output should include something like this -
"-L/opt/lib -lcurl -lz -lssl -lcrypto -ldl -lsocket -lnsl -lz"
If you don't get the ssl or crypto bit, rebuild Curl!

It appears Suns SFWcurl does NOT include SSL support. (?)

(3) Rebuild your PHP --with-curl

(4) Restart Apache with
>apachectl startssl

This works for me.