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

curl-and-php

RE: I can't get https pages

From: Samantha Savvakis <samantha_at_cfs.net.au>
Date: Fri, 31 Aug 2001 09:11:46 +1000

hi,

I've forwarded an email below from Sterling Hughes. I had the same problem
with PHP 4.0.6. I could reach HTTPS sites using the command line, but not
using the PHP/Curl functions. Sterling confirmed that it was a problem with
PHP 4.0.6 and suggested to get the latest release of PHP.

Sam

> -----Original Message-----
> From: curl-and-php-admin_at_lists.sourceforge.net
> [mailto:curl-and-php-admin_at_lists.sourceforge.net]On Behalf Of Sterling
> Hughes
> Sent: Wednesday, 15 August 2001 19:18
> To: curl-and-php_at_lists.sourceforge.net
> Subject: Re: HTTPS, CURL Binary/CURL PHP Functions
>
>
> Hey, thanks for the info -- there was a problem in PHP & CURL in Version
> 4.0.6 -- upgrade to the latest CVS and all should be right with the
> world.
>
> -Sterling
>
> On Wed, 15 Aug 2001, Samantha Savvakis wrote:
>
> > Hi,
> >
> > Version details:
> > SCO OpenServer 5.0.6
> > APACHE 1.3.20
> > PHP 4.0.6 - compiled with curl, openssl. I have a PHP binary installed,
> > aswell as compiled as a module in Apache.
> > CURL 7.8
> > OPENSSL 0.9.6
> >
> > curl --version
> > curl 7.8 (i686-pc-sco3.2v5.0.6) libcurl 7.8 (OpenSSL 0.9.6)
> >
> > I'm posting XML data to a HTTPS site. I took an example from
> the PHPBuilder
> > web site using the curl binary, and modified it for my test:
> >
> > #!/usr/local/bin/php -q
> > <?
> > $strLogonXML = "<?xml version='1.0'?>";
> > $strLogonXML .= "<LOGON_SUB>";
> > $strLogonXML .= "<LOGIN>xxxL</LOGIN>";
> > $strLogonXML .= "<PASSWORD>xxx</PASSWORD>";
> > $strLogonXML .= "</LOGON_SUB>";
> >
> > $URL="https://someurl/page.asp";
> >
> > exec("/usr/local/bin/curl -m 120 -d \"$strLogonXML\"
> > $URL -L -s",$returnarray, $returncode);
> >
> > for ($i = 0; $i < count($returnarray); $i++)
> > {
> > printf("%s\n", $returnarray[$i]);
> > }
> > ?>
> >
> > This works well. I receive XML back from the HTTPS site as expected.
> >
> > So I decided to try to PHP Curl functions:
> >
> > #!/usr/local/bin/php
> > <?
> > $strLogonXML = "<?xml version='1.0'?>";
> > $strLogonXML .= "<LOGON_SUB>";
> > $strLogonXML .= "<LOGIN>xxxL</LOGIN>";
> > $strLogonXML .= "<PASSWORD>xxx</PASSWORD>";
> > $strLogonXML .= "</LOGON_SUB>";
> >
> > $URL="https://someurl/page.asp";
> >
> > $csess = curl_init();
> > curl_setopt($csess, CURLOPT_URL, $URL);
> > curl_setopt($csess, CURLOPT_TIMEOUT, 120);
> > curl_setopt($csess, CURLOPT_POST, 1);
> > curl_setopt($csess, CURLOPT_POSTFIELDS, $strLogonXML);
> > curl_setopt($csess, CURLOPT_FOLLOWLOCATION, 1);
> >
> > $result = curl_exec($csess);
> > curl_close($csess);
> >
> > echo("Result = $result\n");
> > ?>
> >
> > All the options I have set using curl_setopt are the equivalent
> options that
> > I've set on the "curl" binary command line. This does not work,
> and I have
> > no result returned from the HTTPS server.
> >
> > Is there something I'm missing using the PHP functions?
> >
> > Thanks,
> > Sam
> >
> >
> > _______________________________________________
> > Curl-and-php mailing list
> > http://curl.haxx.se/
> >
>
>
> _______________________________________________
> Curl-and-php mailing list
> http://curl.haxx.se/
Received on 2001-08-31