curl-and-php
once more: PHP, cURL and https
Date: Fri, 13 Jul 2001 09:45:44 +0200
Hello everybody,
after wading through several forums, all websites related and contacting
every php guru I know I'm afraid I have to post yet another https-related
question... ;)
I just installed cURL and recompiled PHP (4.0.6) to use it. What I need is
send a POST request from my Server to another one.
When I use this code it works perfectly:
<?
$ch = curl_init ("http://www.server.com/index.php");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "foo=one&bar=two");
curl_exec ($ch);
curl_close ($ch);
?>
But when I try to send it via SSL like this:
<?
$ch = curl_init ("https://www.server.com/index.php");
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, "foo=one&bar=two");
curl_exec ($ch);
curl_close ($ch);
?>
then it fails without giving an error or anything. Apache's error_log is
empty as well.
I tried fiddling with CURLOPT_HEADERS, _FOLLOWLOCATION, _USERAGENT,
_SSLVERSION, _VERBOSE and several others but nothing helps or gives
information.
PHP is compiled like this:
./configure
--with-apache=../apache_1.3.20
--with-mysql=/usr/local/mysql
--with-gd=../gd-1.8.3
--with-jpeg-dir=../jpeg-6b
--with-zlib
--with-openssl=/usr/local/openssl
--with-curl=/usr/local/curl
--enable-track-vars
The receiving server supports SSL.
When I add
<?
echo curl_errno($ch);
echo curl_error($ch);
?>
Just before curl_close($ch);
Then I get "27SSL: couldn't create a context!" as output.
cURL Error Number 27 is related to Memoryissues which are very unlikely
since everything else works (RAM is full but swap and cache are not) so I
guess this Error comes from OpenSSL but what does it mean?
By the way when I execute curl from the bash it works...
Thanks in advance,
Dominique
_______________________________________________
Curl-and-php mailing list
http://curl.haxx.se/
Received on 2001-07-13