|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8552 fopen doesn't open URL
Submitted: 2001-01-04 11:35 UTC Modified: 2001-01-05 14:56 UTC
From: mike at newfangled dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.4 OS: Windows 2000 Server SP1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
49 - 42 = ?
Subscribe to this entry?

 [2001-01-04 11:35 UTC] mike at newfangled dot com
$fp = fopen("","r");

Get "no such file".

Works perfect in php 3.0.16


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-04 11:56 UTC] mike at newfangled dot com
Here's an example of something that works and doesn't work
function GetWebPage( $url, $maxsize=1000000 )
	//	Open a connection to the site
	$fp  = fopen ($url, "r");

	//	Did we find it?
	if (!$fp) 
		//	Nope, return nothing
		return "";

	//	Get the page
	$webpage = fread($fp, $maxsize); 

	//	Close the connection
	fclose( $fp );

	return $webpage;

//	Doesn't work get error
print GetWebPage("");

//	 It Works
print GetWebPage("");


// first GetWebPage fails
Warning: fopen("","r") - No error in D:\extranet\WebTop\site\t.php on line 25

 [2001-01-05 14:56 UTC]
Turns out that the problem is redirects. fopen() doesn't follow
redirects any more. The semantics for fopen() and redirects is
being discussed.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 01 06:05:54 2023 UTC