#23233 [Opn->Bgs]: require() Fails With Absolute File Path in 4.3.1+
| From: | sniper@php.net | Date: | Mon, 21 Apr 2003 17:37:45 +0000 |
| Subject: | #23233 [Opn->Bgs]: require() Fails With Absolute File Path in 4.3.1+ | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-38000@lists.php.net to get a copy of this message | ||
ID: 23233
Updated by: sniper@php.net
Reported By: mdoocy at mac dot com
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Windows NT 4.0 SP6
PHP Version: 4.3.1
New Comment:
This is how it's supposed to work. Not bug.
Previous Comments:
------------------------------------------------------------------------
[2003-04-15 23:25:33] mdoocy at mac dot com
After attempting to upgrade from 4.2.3 to 4.3.1, all require()
statements suddenly failed.
The following scripts were used to test require()'s functionality, and
it was determined that the problem appears to be with the use of
absolute file paths:
------ BEGIN /test.php ------
<html>
<head>
<title>PHP require() Test</title>
</head>
<body>
<?
$test_paths = array
(
"./test1.inc.php", # works
"./test/test2.inc.php", # works
"/test1.inc.php", # works in 4.2.3, fails in 4.3.1+
"/test/test2.inc.php" # works in 4.2.3, fails in 4.3.1+
);
?>
<pre>
PHP Version: <?= phpversion(); ?>
<?
foreach ($test_paths as $path)
{
echo "Requiring '$path': ";
require($path);
echo "\n";
}
?>
</pre>
</body>
------ END /test.php ------
------ BEGIN /test1.inc.php -----
<?= " ...ok." ?>
------ END /test1.inc.php ------
------ BEGIN /test/test2.inc.php ------
<?= " ...ok." ?>
------ END /test/test2.inc.php ------
Output of <http://server.tld/test.php> using PHP
4.2.3 from
<http://www.php.net/get/php-4.2.3-Win32.zip/from/this/mirror>:
------ BEGIN 4.2.3 output ------
PHP Version: 4.2.3
Requiring './test1.inc.php': ...ok.
Requiring './test/test2.inc.php': ...ok.
Requiring '/test1.inc.php': ...ok.
Requiring '/test/test2.inc.php': ...ok.
------ END 4.2.3 output ------
Output of <http://server.tld/test.php> using PHP
4.3.1 from
<http://www.php.net/get/php-4.3.1-installer.exe/from/this/mirror>:
------ BEGIN 4.3.1 output ------
PHP Version: 4.3.1
Requiring './test1.inc.php': ...ok.
Requiring './test/test2.inc.php': ...ok.
Requiring '/test1.inc.php':
Warning: main(/test1.inc.php) [function.main]: failed to create
stream: No such file or directory in C:\InetPub\test.php on line 22
Fatal error: main() [function.main]: Failed opening required
'/test1.inc.php' (include_path='C:\InetPub;c:\php\includes') in
C:\InetPub\test.php on line 22
------ END 4.3.1 output ------
Output of <http://server.tld/test.php> using PHP
4.3.2 from
<http://snaps.php.net/win32/php4-win32-STABLE-200304160030.zip>:
------ BEGIN 4.3.2-RC output ------
PHP Version: 4.3.2-RC
Requiring './test1.inc.php': ...ok.
Requiring './test/test2.inc.php': ...ok.
Requiring '/test1.inc.php':
Warning: main(/test1.inc.php): failed to open stream: No such file or
directory in C:\InetPub\test.php on line 22
Fatal error: main(): Failed opening required '/test1.inc.php'
(include_path='C:\InetPub;c:\php\includes') in C:\InetPub\test.php on
line 22
------ END 4.3.2-RC output ------
[Note the slight difference between the outputs of 4.3.1 and 4.3.2-RC:
the inclusion/exclusion of "[function.main]" after any mention of
main() in a warning or error. Minor difference, but included for
detail.]
Execution of the installation programs (or manual binary/dll copy, in
the case of 4.3.2-RC) are the only changes between tests: no change in
include_path, php.ini, or any other manual configuration were
performed.
Tests were not performed using any versions of PHP between 4.2.3 and
4.3.1.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=23233&edit=1