From:             coder at paco dot net
Operating system: Solaris 8
PHP version:      4.3.4
PHP Bug Type:     *Directory/Filesystem functions
Bug description:  open_basedir error in a dir

Description:
------------
Strange problem with PHP 4.3.4 on Solaris

phpinfo() you can see here http://coder.paco.net/phpinfo.php
test scripts here:
http://coder.paco.net/test/err.php
http://coder.paco.net/err.php

when i try to open file (file('filename.ext')) from root dir everythig
fine, but when from dir "/test" open_basedir restriction error appears.
With full path to file all ok, with ./ path also ok.

Config line: './configure' '--with-apache=../apache_1.3.27rusPL30.17'
'--with-mod_charset' '--with-gd=/usr/local'
'--with-mysql=/usr/local/mysql' '--with-dbase' '--enable-track-vars'
'--enable-memory-limit' '--with-db3=/usr/local/BerkeleyDB.3.3'
'--with-jpeg-dir=/usr/local' '--with-png-dir=/usr/local'
'--with-freetype-dir=/usr/local' '--with-zlib-dir=/usr/local'
'--with-dom=/usr/local' '--with-iconv=/usr/local'
'--with-mnogosearch=/usr/local/mnogo'

PHP-ini: 
open_basedir    
/opt/www/docs:/opt/www/udocs:/opt/www/virtual:/var/tmp/phpupload:/export/home:../:./
include_path    .:..:/usr/local/lib/php
safe_mode       Off

Reproduce code:
---------------
$file = file("/www/udocs/coder/public_html/test/read.php");
$file = file("read.php"); //error string
$file = file("./read.php");



Expected result:
----------------
I expect all files opened.

Actual result:
--------------
file('/www/udocs/coder/public_html/test/read.php'); open file from curren
dir with full path
Array ( [0] => file in "test" dir )

file('read.php'); open file from curren dir

Warning: file(): open_basedir restriction in effect. File(read.php) is not
within the allowed path(s):
(/opt/www/docs:/opt/www/udocs:/opt/www/virtual:/var/tmp/phpupload:/export/home:../:./)
in /opt/www/udocs/coder/public_html/test/err.php on line 8

Warning: file(read.php): failed to open stream: Not owner in
/opt/www/udocs/coder/public_html/test/err.php on line 8

--

-- $file = file('./read.php'); open file from current dir as ./
Array ( [0] => file in "test" dir ) 

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

Reply via email to