ID: 26186 Updated by: [EMAIL PROTECTED] Reported By: jon at banton dot plus dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: Windows 2000 Pro PHP Version: 4.3.4 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php A / or \ at the start of a filename is interpreted as an absolute path. Please read the documentation carefully! Previous Comments: ------------------------------------------------------------------------ [2003-11-09 08:04:17] jon at banton dot plus dot com Description: ------------ I have just installed PHP 4.3.4 but I cannot get the "include" statement to work for virtual paths (those from the root). I am running PHP with Apache 1.3.26 or 1.3.29 on Windows 2000 Pro. The errors I get (2 for each include statement) are all like this: [Sat Nov 08 20:24:35 2003] [error] PHP Warning: main(/includes/dates/date_table.inc): failed to open stream: No such file or directory in c:\apache-web\info_site.phtml on line 54 [Sat Nov 08 20:24:35 2003] [error] PHP Warning: main(): Failed opening '/includes/dates/date_table.inc' for inclusion (include_path='.;c:\apache-web') in c:\apache-web\info_site.phtml on line 54 Include statements work for relative paths, for full file paths and for HTTP URLs, but not for virtual paths. They used to work: I have been using PHP Version 4.2.1 with Apache 1.3.26 successfully for some time. To eliminate other factors, first I downloaded the latest version of Apache (I was using my existing version, which was 1.3.26). But changing to 1.3.29 made no difference. Then I tried installing a previous version of PHP - I tried 4.3.0, but this produces the same error. In case I had done something in my original installation (4.2.1) that I had forgotten about, I downloaded a fresh copy of 4.2.1 and installed and ran that using exactly the same procedure as I used for 4.3.4 and 4.3.0. Yes, that still worked, so the problem was in 4.3.0 and 4.3.4. Other measures I have tried include (no pun intended): changing the value of "include_path" from ".;c:\apache-web" to "c:\apache-web;." changing the back slash to a forward slash (from ".;c:\apache-web" to "c:/apache-web;.") changing the back slash to a double back slash (from ".;c:\apache-web" to ".;c:\\apache-web") [clutching at straws here] In all cases, phpinfo() reported the correct value of "include_path" Is this a known bug? I have tried searching the reported bugs for PHP, but nothing showed up. This does seem to be too fundamental to have escaped notice for (at least) four versions, though. Reproduce code: --------------- <?php include '/includes/check_browser.inc' ?> Expected result: ---------------- File included (i.e. no entry in error.log) Actual result: -------------- Following entries in error.log: [Sat Nov 08 16:33:20 2003] [error] PHP Warning: main(/includes/check_browser.inc): failed to open stream: No such file or directory in c:\apache-web\info_site.phtml on line 9 [Sat Nov 08 16:33:20 2003] [error] PHP Warning: main(): Failed opening '/includes/check_browser.inc' for inclusion (include_path='.;c:\apache-web') in c:\apache-web\info_site.phtml on line 9 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26186&edit=1
