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

curl-and-php

Re: Curl script giving "Page Not Found" about 50% of the time...

From: Dave Withnall <withnall_at_connexus.net.au>
Date: Mon, 24 Feb 2003 17:13:58 +1000

>So, what is happening is that 50% (seemingly randomly, doing the exact same
>action) the script will fail and instantly return a "Page not Found" error
>in the browser. I have set the timeout in PHP to be 30 seconds, but it will
>fail almost right away, so that can't be the problem.

Page not found is the webserver telling the client that wotever they're
looking for doesn't exist.
Something is wrong with the webserver if you're sure the pages do exist.

>What is the best way to go about finding the problem here? I couldn't find
>any details on logging with libcurl...

Look at the logs on the webserver to find out whats going wrong. cURL is
doing what its been told to.
That will tell you what pages are being looked at, if those pages don't
exist then rewrite the script to get them.
If they do exist find out why your webserver is rejecting them.

>Also, after getting the result from this page, we use a header location to
>forward to the new page. Is this better done with curl using the
>CURLOPT_FOLLOWLOCATION (I can't seem to find much documentation on this
>one).

Yes,
curl_setop($ch, CURLOPT_FOLLOWLOCATION, TRUE);
will do what you're after.

D.

-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
Received on 2003-02-24