CURL Request Stopped working

For years I've been running a daily curl script that tracks stock quotes through Yahoo finance.  Just the other day the CURL request stopped working.

The URL that I'm using works fine in a browser and gives me the option of downloading the CSV. Here is the URL:
http://download.finance.yahoo.com/d/quotes.csv?s=AAWW+ATTU+CJES+CLRO&f=sd1noghl1vpt7t8erdjka2j4j1m3m4w1ba

If you click on this link it will ask you about opening a CSV file on your computer which gives the exact fields that I want.

Previously this worked fine using a CURL request. But as of last Thursday something changed.  It may be that Yahoo changed something or my PHP version may have been upgraded on my hosting server which caused something to not work.  

Here's the code that worked fine until last Thursday.

       $url = "http://download.finance.yahoo.com/d/quotes.csv?s=AAWW+ATTU+CJES+CLRO&f=sd1noghl1vpt7t8erdjka2j4j1m3m4w1ba";
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_HEADER, 0); 
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
	$var = curl_exec($ch); 
	curl_close($ch);
	print 'CURL RESPONSE: <textarea cols=100 rows=25>'.$var.'</textarea>'; die ("at stockPull stop point");

Open in new window


In the past, this textarea would show the same data that you see from going straight to the URL. But now it just gets caught in a loop that gives an error message in the logs of:
mod_fcgid: read data timeout in 120 seconds, referer: http://www.mydomain.com/look.php?a=new
Premature end of script headers: look.php, referer: http://www.mydomain.com/look.php?a=new

Any insight into why the CURL request no longer works would be appreciated.

Thanks.
Paul KonstanskiProject SpecialistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

KimputerCommented:
It works for me, but then, no changes were done on my system recently. Did anyone change any parameters/config files/settings to your webserver? Maybe even update some components (apache/php)?
Also, run Wireshark (on the machine where the PHP is located), to see the exact traffic to and from Yahoo. If the request really times out, a browser (on that same machine) should theoretically also time out.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Paul KonstanskiProject SpecialistAuthor Commented:
Thanks for testing it.

It got me thinking that maybe I should test on one of my other servers which I did and it works fine.

I'm doing some research to see if I can determine what setting on the machine may have changed.
0
Ray PaseurCommented:
cURL returns error information when it fails.  If you want to see a code sample that will help visualize it, please post a Q and I'll be glad to show you what PHP can tell you about.
0
Paul KonstanskiProject SpecialistAuthor Commented:
Ray,

I posted the question here:
http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/Q_28668385.html

The points away... :)

Thanks.

Paul
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.