|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-04-21 12:37 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 06:00:01 2026 UTC |
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.