|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-08-26 10:45 UTC] ronaldo at inbox dot lv
I'm using PhP 4.0.6 with Apache 1.3 and the
problem is opening remote files with fopen("http://...");
The following code:
>$fp = fopen("http://www.php.net", "r") or die("OPEN");
>while (! feof($fp))
>{
> fread($fp, 1024) or die("READ");
>}
>fclose($fp) or die("CLOSE");
Produced the following output:
>Warning: php_hostconnect: connect failed in filename.php..
>
>Warning: fopen("http://www.php.net","r") - Bad file
>descriptor in filename.php..
I tried to use fsockopen() with my IE proxy and port settings - it was successful. Maybe the problem is in Apache configuration, but I just can't figure that out!
If you can help, please, send to my email: ronaldo@inbox.lv
Kind regards
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 17:00:02 2025 UTC |
I got a slightly different error: Warning: fopen("http://www.php.net","r") - No error in e:\sander\webserver\http\test\test1.php on line 10 If you append a / to the url, it works: fopen("http://www.php.net/", "r") The errors are a bit weird though... Let's make it a bogus.try this: $my_file = file ("http://www.google.com/search?q=%22invented%20the%20car%22&btnG=Google+Search"); it will result: No error in my_script.php on line xxx I have Win98SE PHP 4.3.4 OmniHTTPD 2.10 IE 5.5 The same thing works under PHP 4.3.4, Win2000 with IIS and IE6