From:             jon at banton dot plus dot com
Operating system: Windows 2000 Pro
PHP version:      4.3.4
PHP Bug Type:     Unknown/Other Function
Bug description:  include_path ignored using include with virtual path

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 bug report at http://bugs.php.net/?id=26186&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26186&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26186&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26186&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26186&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26186&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26186&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26186&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26186&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26186&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26186&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26186&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26186&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26186&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26186&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26186&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26186&r=float

Reply via email to