ID: 37907
User updated by: sreniaw at wp dot pl
Reported By: sreniaw at wp dot pl
-Status: Open
+Status: Closed
Bug Type: Safe Mode/open_basedir
Operating System: Solaris
PHP Version: 5.1.4
New Comment:
It has been solved.
Previous Comments:
------------------------------------------------------------------------
[2006-06-25 12:26:20] sreniaw at wp dot pl
Is there any way to use open_basedir without absolute path ?
In my case reading file in the directory of the current script lead to
open_basedir restriction.
open_basedir = /wwwroot/default
directory of the current script = /wwwroot/default
txt file I want to read is in = /wwwroot/default
I think that everything is ok. Why do I have this Warning ?
------------------------------------------------------------------------
[2006-06-25 10:46:26] [EMAIL PROTECTED]
Use absolute path or PHP will search file in the directory of the
current script.
------------------------------------------------------------------------
[2006-06-25 10:39:31] sreniaw at wp dot pl
Description:
------------
I have configured php'a open_basedir for directory /wwwroot/default in
httpd.conf.
open_basedir = /wwwroot/default
/wwwroot/default
-test.txt
-test.php
I've tryied to read test.txt file, but I can not do it
baceuse of open_basedir restriction.
Reproduce code:
---------------
<?php
readfile("test.txt");
?>
Expected result:
----------------
Read file test.txt
Actual result:
--------------
Warning: readfile() [function.readfile]: open_basedir restriction in
effect. File(test.txt) is not within the allowed path(s):
(/wwwroot/default) in /wwwroot/default/test.php on line 2
Warning: readfile(test.txt) [function.readfile]: failed to open stream:
Not owner in /wwwroot/default/test.php on line 2
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37907&edit=1