#40141 [Opn->Fbk]: open_basedir vs. tmpfile()
| From: | tony2001@php.net | Date: | Tue, 16 Jan 2007 08:25:44 +0000 |
| Subject: | #40141 [Opn->Fbk]: open_basedir vs. tmpfile() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-107644@lists.php.net to get a copy of this message | ||
ID: 40141
Updated by: tony2001@php.net
Reported By: flobee at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: *Directory/Filesystem functions
Operating System: debian etch
PHP Version: 5.2.0
New Comment:
Make sure /tmp/ is not a symlink.
Previous Comments:
------------------------------------------------------------------------
[2007-01-16 01:13:59] flobee at gmail dot com
Description:
------------
using php_admin_value open_basedir "/home/somthing/" in vhosts i get
problems to run the function tmpfile()
vhost setting:
php_admin_value open_basedir "/home/somthing/:/tmp/"
or tested with ... does the same error:
php_admin_value open_basedir "/home/somthing/"
without open_basedir the function works like expected :-/
Reproduce code:
---------------
<?php
// --- tests
-----------------------------------------------------------
<?php
$temp = tmpfile();
fwrite($temp, "writing to tempfile");
fseek($temp, 0);
echo 'x:'.fread($temp, 1024);
fclose($temp); // this removes the file
//----------------------------------------------------------------------
?>
Actual result:
--------------
Warning: tmpfile() [function.tmpfile]: open_basedir restriction in
effect. File(/tmp) is not within the allowed path(s):
(/home/abc/:/tmp/) in index.php on line 123
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40141&edit=1