Click to See Complete Forum and Search --> : Compiling PHP with cURL support (with SSL support)


Anon
09-27-2000, 07:40 AM
Hello,

I've been trying for several days now to compile php with curl support. Below is a quick scenario of what I've been through so far.

I compiled and installed openssl into /usr/local/ssl/. /usr/local/ssl/lib contains the (static) libraries, crypto and ssl - good. This all worked dandy.

Now, I compiled cURL with the configure option: --with-ssl=/usr/local/ssl. This worked good. I did a make install, and found the curl binary in /usr/local/bin/curl. The (static and shared) curl libraries were in /usr/local/lib. I was able to connect-to and retrieve pages from a secure(https) server.

So far, very good.

Now I went to compile php with the configure option --with-curl. Configure decided to use the shared curl library, and returned errors:

gcc -o conftest -g -O2 <snip this line>
/usr/local/lib/libcurl.so: undefined reference to `SSL_set_fd'
/usr/local/lib/libcurl.so: undefined reference to `SSL_set_connect_state'
/usr/local/lib/libcurl.so: undefined reference to `SSL_CTX_free'
/usr/local/lib/libcurl.so: undefined reference to `X509_free'

That is a few, there are about 20 lines of SSL_* undefined references.

I deleted the shared curl library, and did a make distclean and a configure again on php. It seemed to work okay this time - no errors. It evern compiled and installed okay.

Now I go to compile apache. At the (I think) very end of the compile, when it goes to link the httpd binary, I get this:

gcc -I/usr/home/david/apache/php-4.0.2 -I/usr/home/david/apache/php-4.0.2/main -I/usr/home/david/apache/php-4.0.2/main -I/usr/home/david/apache/php-4.0.2/Zend -I/usr/home/david/apache/php-4.0.2/Zend -I/usr/home/david/apache/php-4.0.2 -DUSE_EXPAT -I./lib/expat-lite `./apaci` -rdynamic \
-o httpd buildmark.o modules.o modules/standard/libstandard.a modules/php4/libphp4.a main/libmain.a ./os/unix/libos.a ap/libap.a lib/expat-lite/libexpat.a -Wl,-rpath,/usr/local/lib -rdynamic -L/usr/local/lib -Lmodules/php4 -L../modules/php4 -L../../modules/php4 -lmodphp4 -ldl -lgd -L/usr/local/ssl/lib -lssl -lcrypto -lcurl -lresolv -lm -ldl -lresolv -ldl
/usr/local/lib/libcurl.a(getdate.o): In function `gd_parse':
/opt/TWWfsw/bison/share/bison.simple:249: multiple definition of `gd_parse'
modules/php4/libphp4.a(parsedate.o):/usr/lib/bison.simple:249: first defined here
/usr/local/lib/libcurl.a(url.o): In function `urlfree':
/usr/home/david/apache/curl-7.2.1/lib/url.c:149: undefined reference to `SSL_shutdown'
/usr/home/david/apache/curl-7.2.1/lib/url.c:150: undefined reference to `SSL_set_connect_state'
/usr/home/david/apache/curl-7.2.1/lib/url.c:152: undefined reference to `SSL_free'
/usr/home/david/apache/curl-7.2.1/lib/url.c:156: undefined reference to `SSL_CTX_free'

There are a few more, but this should be enough.

Okie, dokie. I've done everything I can think of. Does anyone have any ideas on what is going on here?
If you need more info, please ask. I'll suply as much as I have.

PHP Version: 4.0.2
Apache version: 1.3.12
cURL Version: 7.2.1
OpenSSL Version: 0.9.6
OS Version: BSD/OS tech 4.0.1 BSDI BSD/OS 4.0.1

Thank you for your help,
David Newhall

Anon
09-27-2000, 05:55 PM
Hmm... From what I understand, you suppose to call cURL using exec(...) from within PHP! I don't think you can compile it into PHP, I could be wrong.

Anon
09-28-2000, 03:22 AM
You're wrong - PHP 4.0.2 is supposed to support it. Please see http://www.php.net/manual/ref.curl.php

Using exec() would work for me, but I need to pass login information to the https server. If I used exec(), that login info would be available to anyone smart enough to use `top` or `ps`.

Anyone else have any ideas?

David Newhall

Anon
09-28-2000, 07:10 AM
Same exact problem using curl 7.3.
*sniffle*


David Newhall