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

curl-and-php

Re: CURLOPT_UPLOAD gives me a Seg Fault

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 15 May 2002 10:57:00 +0200 (MET DST)

On Wed, 15 May 2002, Raoul Mackle wrote:

> The problem I am having is that PHP is kicking out a seg fault (11) when
> trying to upload a file to another web server (as1) for processing before
> receiving the output from that server to be stored in the first web servers
> DB (ws1).

Would you be capable of getting a stack trace from the core dump?

> This used to go quite well using cURL7.8 but when I upgraded to PHP4.2.0
> from PHP4.0.6 I had to also upgrade to cURL7.9. This caused quite a large
> problem for me as now using this code here I get a segmentation fault on
> ws1.

This code shows some confusions:

> $ch = curl_init( $url );
> curl_setopt( $ch, CURLOPT_UPLOAD, true );

This implies a PUT.

> curl_setopt( $ch, CURLOPT_POST, false );

This implies a "normal" POST.

> curl_setopt( $ch, CURLOPT_HTTPPOST, $postData );

This implies a multipart formpost.

BTW, is this really the way to use this option? I don't know, but this is not
the way you do it using C so I thought I'd just double-check this.

> Through deduction I found that if I commented out the line 'curl_setopt(
> $ch, CURLOPT_UPLOAD, true );' it would work (not kill PHP) but however it
> would not upload the file (of course) therefore defeating the purpose of
> this function anyway.

I would be very happy if you could try to perform this operation using the
command line tool instead. It would help us work out a little where this
specific problem might be.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: bandwidth_at_sourceforge.net
Received on 2002-05-15