## #26186 [Bgs]: include_path ignored using include with virtual path

ID: 26186
User updated by: jon at banton dot plus dot com
Reported By: jon at banton dot plus dot com
Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Windows 2000 Pro
PHP Version: 4.3.4
New Comment:

carefully. I know what the initial "/" or "\" means, but the correct
term is virtual, as an absolute path includes scheme (e.g. http). The
fact is that the initial "\" indicates that the file should be located
starting at the root, which is specified in the "include_path"
statement. As I said, in version 4.2.1 (and I have since checked
4.2.3) it works. But in 4.3.0 it does not. The only difference is the
version of PHP, not my "include_path" setting, or any of my source
files.

------------------------------------------------------------------------

[2003-11-09 08:28:30] [email]wezphp.net[/email]

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the doentation available at
[url]http://www.php.net/manual/[/url] and the instructions on how to report
a bug at [url]http://bugs.php.net/how-to-report.php[/url]

A / or \\ at the start of a filename is interpreted as an absolute
path.

------------------------------------------------------------------------

[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.

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
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 [url]http://bugs.php.net/?id=26186&edit=1[/url]