views:

311

answers:

1

I am trying to read a file in with file_get_contents () - it's a remote HTTP file, and I've checked the URL and it's fine. Only it doesn't work.

More to the point the the error message is the standard Firefox server error:

The connection was reset

The connection to the server was reset while the page was loading.

... rather than any form of PHP error. It also only took a couple of seconds to come back so it can't be hitting the script runtime limit - any ideas on what is going wrong here?

It's PHP 5 on Apache 2, running on Windows btw.

To clarify it's my connection to my .php file that is having this issue. Even if the remote file wasn't there I'd at least expect an error - that my webserver is apparently dropping the connection rather than at least giving an error message is the issue.

*Update 2: Same issue with fopen instead of file_get_contents*

Update 3: It may even be crashing the server:

[Sun Mar 28 17:46:21 2010] [notice] Server built: Dec 10 2008 00:10:06
[Sun Mar 28 17:46:21 2010] [notice] Parent: Created child process 2720
[Sun Mar 28 17:46:21 2010] [notice] Child 2720: Child process is running
[Sun Mar 28 17:46:21 2010] [notice] Child 2720: Acquired the start mutex.
[Sun Mar 28 17:46:21 2010] [notice] Child 2720: Starting 64 worker threads.
[Sun Mar 28 17:46:21 2010] [notice] Child 2720: Starting thread to listen on port 80.
[Sun Mar 28 17:46:24 2010] [notice] Parent: child process exited with status 255 -- Restarting.
[Sun Mar 28 17:46:24 2010] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Sun Mar 28 17:46:24 2010] [notice] Server built: Dec 10 2008 00:10:06
[Sun Mar 28 17:46:24 2010] [notice] Parent: Created child process 4912
[Sun Mar 28 17:46:24 2010] [notice] Child 4912: Child process is running
[Sun Mar 28 17:46:24 2010] [notice] Child 4912: Acquired the start mutex.
[Sun Mar 28 17:46:24 2010] [notice] Child 4912: Starting 64 worker threads.
[Sun Mar 28 17:46:24 2010] [notice] Child 4912: Starting thread to listen on port 80.
[Sun Mar 28 17:46:31 2010] [notice] Parent: child process exited with status 255 -- Restarting.
[Sun Mar 28 17:46:31 2010] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Sun Mar 28 17:46:31 2010] [notice] Server built: Dec 10 2008 00:10:06
[Sun Mar 28 17:46:31 2010] [notice] Parent: Created child process 2560
[Sun Mar 28 17:46:31 2010] [notice] Child 2560: Child process is running
[Sun Mar 28 17:46:31 2010] [notice] Child 2560: Acquired the start mutex.
[Sun Mar 28 17:46:31 2010] [notice] Child 2560: Starting 64 worker threads.
[Sun Mar 28 17:46:31 2010] [notice] Child 2560: Starting thread to listen on port 80.
[Sun Mar 28 17:46:34 2010] [notice] Parent: child process exited with status 255 -- Restarting.
[Sun Mar 28 17:46:34 2010] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
[Sun Mar 28 17:46:34 2010] [notice] Server built: Dec 10 2008 00:10:06
[Sun Mar 28 17:46:34 2010] [notice] Parent: Created child process 712
[Sun Mar 28 17:46:34 2010] [notice] Child 712: Child process is running
[Sun Mar 28 17:46:34 2010] [notice] Child 712: Acquired the start mutex.
[Sun Mar 28 17:46:34 2010] [notice] Child 712: Starting 64 worker threads.
[Sun Mar 28 17:46:34 2010] [notice] Child 712: Starting thread to listen on port 80.
[Sun Mar 28 17:49:19 2010] [notice] Parent: child process exited with status 255 -- Restarting.
[Sun Mar 28 17:49:19 2010] [notice] Apache/2.2.11 (Win32) PHP/5.3.0 configured -- resuming normal operations
A: 

Use cUrl and make a connection by a proxy: CURLOPT_HTTPPROXYTUNNEL

Frank Heikens