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

curl-and-php

Curl + php + ssl = free() invalid pointer

From: Tom Cannaerts <curl_at_cakkie.be>
Date: Sat, 2 Sep 2006 01:39:36 +0200

Hi everyone,

 

I'm having this strange problem here.

 

I'm running a debian server with a 2.6 kernel.

I've installed PHP 5.1.6, Apache 2.2.2, Openssl 0.9.8b and
libcurl3-dev_7.15.5-1

 

The problem occurs when I try to fetch a url using ssl from PHP, using the
following code:

 

<?php

        $url = "https://someserver/somefile.ext";

        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);

        curl_setopt($ch, CURLOPT_HEADER, 0);

        curl_exec($ch);

        curl_close($ch);

?>

 

When I pull this file up in a browser, it works fine and prints the contents
of the file specified.

However, when I call this file from the commandline, I get the following
error:

 

*** glibc detected *** free(): invalid pointer: 0x40158640 ***

 

I already found out that the error occurs when calling curl_exec.

 

The strange thing is that when I run the php file from the command line, it
gives me this error, but when I call the php file from a browser (through
apache), it Works without a problems. If I simply run curl from the
commandline, it works just fine. If I give a http:// instead of a https://,
the everything works fine as well.

 

Does anyone know what might be wrong?

 

Kind regards,

 

Tom

 

 

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-09-02