cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: once more: PHP, cURL and https

From: Chris Alsop <chris_at_mindpointe.com>
Date: Fri, 13 Jul 2001 07:04:21 -0400

i had the same problem and never did get a response. as a quick workaround i
just used an exec to trap the response since it worked from a shell:

$s = exec("/usr/local/bin/curl -d \"$DataToPost\");

and it worked. i am still trying to figure out why i cannot use it within
php.

-----Original Message-----
From: curl-and-php-admin_at_lists.sourceforge.net
[mailto:curl-and-php-admin_at_lists.sourceforge.net]On Behalf Of Dominique
Stender
Sent: Friday, July 13, 2001 3:46 AM
To: curl-and-php_at_lists.sourceforge.net
Subject: once more: PHP, cURL and https

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/

_______________________________________________
Curl-and-php mailing list
http://curl.haxx.se/
Received on 2001-07-13