From: quasi at di dot uoa dot gr
Operating system: Solaris 10
PHP version: 5.2.3
PHP Bug Type: *Directory/Filesystem functions
Bug description: require fails to include relative path names
Description:
------------
commands like require('../somefile') fail although they didn't in versions
prior to 5.2.0. This happens when the user running the command does not
have 'r' rights to the directory of the included file. Bug #39351 seems
related but it is supposedly closed.
Reproduce code:
---------------
cd tmp
umask 022
mkdir d1
chmod 711 d1
cd d1
echo Included > fin.php
mkdir d2
cd d2
echo '<? require("/tmp/d1/fin.php") ?>' > f.php
echo '<? require("../fin.php") ?>' >> f.php
php /tmp/d1/d2/f.php
Expected result:
----------------
Included
Included
Actual result:
--------------
Included
Warning: require(../fin.php): failed to open stream: Permission denied in
f.php on line 2
Fatal error: require(): Failed opening required '../fin.php'
(include_path='.:/opt/php/lib/php') in f.php on line 2
--
Edit bug report at http://bugs.php.net/?id=42048&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=42048&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=42048&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=42048&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42048&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=42048&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42048&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42048&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42048&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42048&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42048&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=42048&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=42048&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42048&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42048&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42048&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42048&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42048&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42048&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42048&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42048&r=mysqlcfg