Page 1 of 1

no curl/libcurl ssl/https support, why?

PostPosted: 31. July 2006 19:32
by hm2k
According to this page: http://curl.haxx.se/download.html

You can download the libcurl for windows which is supported by Windows XP and Windows 2000.

It should work fine with the PHP and Apache setup, and you can either have the libcurl or the binary, either will support SSL.

My question is, WHY oh WHY does XAMPP NOT already support https/ssl urls, when trying to use curl via php that is included in XAMPP?

I'm sure AF could easily include this in the next release.

PostPosted: 31. July 2006 19:50
by Wiedmann
It should work fine with the PHP and Apache setup, and you can either have the libcurl or the binary, either will support SSL.

As you can read in the PHP manual, you don't need "libcurl" for the CURL extension.

My question is, WHY oh WHY does XAMPP NOT already support https/ssl urls, when trying to use curl via php that is included in XAMPP?

The CURL extension support HTTPS and I have no problem to use such URI in a test script.

PostPosted: 01. August 2006 00:05
by Izzy
@hm2k
Try https://localhost/

Also in the XAMPP admin Welcome page there is this:
For OpenSSL support please use the test certificate with https://127.0.0.1 or https://localhost

Once you are in the https://localhost/ welcome page all php links in the menu are now loaded using https. Click on the Status menu and you should see HTTPS (SSL) Activated

Now you can proceed to do your testing from there.

You may have to create a new certificate for your use as, I believe, the test cert. has expired and may give an error message in your browser.

PostPosted: 01. August 2006 17:41
by hm2k
Okay, so lets see here...

From http://uk.php.net/curl

Installation

To use PHP's CURL support you must also compile PHP --with-curl[=DIR] where DIR is the location of the directory containing the lib and include directories. In the "include" directory there should be a folder named "curl" which should contain the easy.h and curl.h files. There should be a file named libcurl.a located in the "lib" directory. Beginning with PHP 4.3.0 you can configure PHP to use CURL for URL streams --with-curlwrappers.

Note to Win32 Users: In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH.

You don't need libcurl.dll from the CURL site.


However, you WILL find php_curl.dll here: "C:\Program Files\XAMPP\php\extensions\" included with XAMPP.

Using OpenSSL is NOT the same as using CURL to access https sites.

An example of curl usage with php can be found here: http://curl.haxx.se/libcurl/php/examples/simpleget.html -- lets use a known https address, eg: https://adwords.google.com/select/

Code: Select all
<?php
//
// A very simple example that gets a HTTP page.
//

$ch = curl_init();

curl_setopt ($ch, CURLOPT_URL, "https://adwords.google.com/select/");
curl_setopt ($ch, CURLOPT_HEADER, 0);

curl_exec ($ch);

curl_close ($ch);
?>


Results in a blank page.

Izzy, what you're talking about is Apache SSL support, NOT curl or PHP.

Besides, infact when I do visit either of those addresses, I get the following error (or similar): The connection to 127.0.0.1 was interrupted while the page was loading.

PostPosted: 01. August 2006 17:57
by Wiedmann
However, you WILL find php_curl.dll here: "C:\Program Files\XAMPP\php\extensions\" included with XAMPP.

Right, and in "C:\Program Files\XAMPP\php\ext\". These are the extensions for PHP4 and PHP5.

Note to Win32 Users: In order to enable this module on a Windows environment, libeay32.dll and ssleay32.dll must be present in your PATH.

These files are in ""C:\Program Files\XAMPP\apache\bin", so Apache and PHP can find them.

You don't need libcurl.dll from the CURL site.

You remember my last post?

Using OpenSSL is NOT the same as using CURL to access https sites.

You are talking to me?

Code: Select all
<?php
//
// A very simple example that gets a HTTP page.
//

$ch = curl_init();

curl_setopt ($ch, CURLOPT_URL, "https://adwords.google.com/select/");
curl_setopt ($ch, CURLOPT_HEADER, 0);

curl_exec ($ch);

curl_close ($ch);
?>

Results in a blank page.

At line 10 you must add this:
Code: Select all
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);