curl-and-php
Re: FOLLOWLOCATION kills Apache?
Date: Sat, 25 Dec 2004 14:35:34 +0100
On Dec 25, 2004, at 8:52 AM, Daniel Stenberg wrote:
> On Fri, 24 Dec 2004, Josh Santangelo wrote:
>
>> If I set CURLOPT_FOLLOWLOCATION to 1, my script runs forever and the
>> Apache process dies.
>
> You mean the Apache process which runs your PHP program? How can
> libcurl make it die?
Yup. No idea how that could happen.
> You need to provide us with more details on what curl sends and
> receives, header-wise. Use CURLOPT_VERBOSE and CURLOPT_DEBUGFUNCTION
> to get all details.
Is there documentation on those somewhere?
>> curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/curlcookie_' . time());
>
> This option writes the received cookies to a file, it doesn't read
> them before sending off your (first) request.
That's okay in this case.
>> 'Content-Type: application/x-www-form-urlencoded',
>> 'Content-Length: ' . strlen($postfields)
>
> Both these headers are set by libcurl itself when you POST, so your
> setting of them is not necessary.
I figured that, but I was setting them explicitly since things weren't
working right and I wasn't sure what curl was sending.
Actually I seem to have found the problem, though I don't necessarily
understand it. Further up in the code is a call to session_start().
When that is removed everything works fine.
-josh
Received on 2004-12-25