#23282 [NEW]: include and require break with "./"
| From: | russell+php dot net at loosenut dot com | Date: | Sun, 20 Apr 2003 02:48:09 +0000 |
| Subject: | #23282 [NEW]: include and require break with "./" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-37916@lists.php.net to get a copy of this message | ||
From: russell+php dot net at loosenut dot com
Operating system: Solaris
PHP version: 4.3.2RC1
PHP Bug Type: Scripting Engine problem
Bug description: include and require break with "./"
It would appear that "include" and "require" bork if you include a file
with "./" -- however, excluding the dot-slash, the files are correctly
included from the current directory or relative subdirectories. Previous
versions of PHP (testing in 4.1.s) work just fine with identical scripts.
According to "phpinfo();" run on the server in this same directory, I
have:
Directive: include_path
Local Value: .:/usr/local/php-4.3.2rc1/lib/php
Master Value: .:/usr/local/php-4.3.2rc1/lib/php
Safe mode is also off.
Test case:
-- begin
<HTML>
<HEAD>
<TITLE>PHP Test Case</TITLE>
</HEAD>
<BODY>
<P>
Testing:
<?PHP
// index.php
print( "Including file:<BR>\n" );
include( "file.php" );
print( "Including file with dot-slash:<BR>\n" );
include( "./file.php" );
?>
</BODY>
</HTML>
-- end
-- begin
<?PHP
// file.php
print( "<B>File Successfully Included</B><BR>\n" );
?>
-- end
...if all goes well, you should see "File Successfully Included" twice --
however, it only shows up once and the second line shows an error in the
error logs.
Here are the error messages that the two above files generate (Apache
1.3.27):
-- begin
[Thu Apr 17 02:38:11 2003] [error] PHP Warning: main (./file.php) [<a
href='http://www.php.net/function.main'>function.main</a>]:
failed to open
stream: No such file or directory in
/export/home/russell/public_html/inc-problem/index.php on line 18
[Thu Apr 17 02:38:11 2003] [error] PHP Warning: main() [<a
href='http://www.php.net/function.include'>function.include</a>]:
Failed
opening './file.php' for inclusion
(include_path='.:/usr/local/php-4.3.2rc1/lib/php') in
/export/home/russell/public_html/inc-problem/index.php on line 18
-- end
--
Edit bug report at http://bugs.php.net/?id=23282&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=23282&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=23282&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=23282&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=23282&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=23282&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=23282&r=support
Expected behavior: http://bugs.php.net/fix.php?id=23282&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=23282&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=23282&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=23282&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23282&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=23282&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=23282&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=23282&r=gnused