HTTP request fails?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aye
Forum Commoner
Posts: 25
Joined: Wed Apr 11, 2007 9:02 am

HTTP request fails?

Post by aye »

Hi everyone! I'm trying to read a gzip compressed file using the gzfile() function. The problem is that ~1/3 of all the pages I am trying to read gives a HTTP request failed error ([function.gzfile]: failed to open stream: HTTP request failed!), even though it is accessbile through the browser. Does anyone know what causes this error and how it can be fixed?
Any help with this would be great! :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Are these files on the same server as your script? If so, there's no reason to use HTTP requests to read the files.
aye
Forum Commoner
Posts: 25
Joined: Wed Apr 11, 2007 9:02 am

Post by aye »

No.. files are located on other servers
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

PHP may not receive a result from the server you are requesting from in the time frame PHP expects to receive said result in.

What are you attempting to do?
aye
Forum Commoner
Posts: 25
Joined: Wed Apr 11, 2007 9:02 am

Post by aye »

feyd wrote:PHP may not receive a result from the server you are requesting from in the time frame PHP expects to receive said result in.

What are you attempting to do?
I'm scraping a torrent tracker. scrape files can be quite large (up to 15mb). Maybe the problem is in that then..
So.. how do you fix this? increase max_execution_time ?
Post Reply