php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #36860 file:// does not work with allow_url_fopen=Off
Submitted: 2006-03-25 22:26 UTC Modified: 2006-04-03 17:58 UTC
From: php-bugs at t43 dot mine dot nu Assigned:
Status: Closed Package: Documentation problem
PHP Version: 5.1.2 OS: Windows
Private report: No CVE-ID: None
 [2006-03-25 22:26 UTC] php-bugs at t43 dot mine dot nu
Description:
------------
As I set allow_url_fopen=Off,the stream prefix file:// is not accepted.

In addition, relative paths do not work with allow_url_fopen=On.
i.e. require('file://include.inc.php') obtains an error, 
but require('file://c:/mydirectories/public/include.inc.php') does work perfectly.

The error message to require('file://include.inc.php') is: 
Warning: require() [function.require]: remote host file access not supported, file://include.inc.php in C:\mydirectories\public\myscript.php on line 999


Reproduce code:
---------------
require('file://include.inc.php');

Expected result:
----------------
same as when doing
require('include.inc.php');
 
and additionally no matter if allow_url_fopen=On/Off


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-26 01:00 UTC] tony2001@php.net
1) file:// without c:/ or additional / is invalid URL.
2) there is allow_url_include in PHP6, but it won't be backported to 5.1. Not sure about 5.2, though.
 [2006-03-26 03:27 UTC] php-bugs at t43 dot mine dot nu
Regarding 1), illegal URL, but the php Manual, appendix M has the following text:
"file:// is the default wrapper. ... Explicitly using file:// since PHP 4.3.0
/path/to/file.ext
relative/path/to/file.ext
fileInCwd.ext
C:/path/to/winfile.ext
C:\path\to\winfile.ext
\\smbserver\share\path\to\winfile.ext
file:///path/to/file.ext"

"Default wrapper" wording leads to the idea that file:// is being prefixed implicitely to all forms, and can therefore be prefixed explicitely too.
 [2006-03-26 03:28 UTC] php-bugs at t43 dot mine dot nu
In addition file:// could be allowed  anyway, even if allow_url_fopen=Off, for easier programming.
 [2006-04-03 17:58 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

I've changed "file://" to "Filesystem" in the "default wrapper" sentence.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 22:01:33 2025 UTC