Bug #52065 [Com]: Warning about open_basedir restriction while accessing a file as directory

From: Date: Wed, 28 Feb 2018 22:26:09 +0000
Subject: Bug #52065 [Com]: Warning about open_basedir restriction while accessing a file as directory
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-214154@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=52065&edit=1 ID: 52065 Comment by: a19836 at gmail dot com Reported by: manuel at mausz dot at Summary: Warning about open_basedir restriction while accessing a file as directory Status: Verified Type: Bug Package: Safe Mode/open_basedir Operating System: Unix PHP Version: 5.6.8 Block user comment: N Private report: N New Comment: Why isn't this bug fixed yet? It was detected in 2013 or even before. And already passed 5 years... I trying the following example with PHP 7 and I'm getting exactly the same error. <? ini_set("open_basedir", __DIR__); file_put_contents(__DIR__ . "/foo.txt", "bar"); echo "EXISTS:".file_exists(__DIR__ . "/foo.txt/"); ?> Error: PHP Warning: file_exists(): open_basedir restriction in effect. File(/var/www/html/test/foo.txt/) is not within the allowed path(s): (/var/www/html/test) in /var/www/html/test/test.php on line 4 Can you please fix this and let me know please? Thanks Previous Comments: ------------------------------------------------------------------------ [2017-02-26 15:32:58] requinix@php.net Related To: Bug #74171 ------------------------------------------------------------------------ [2015-09-22 10:20:43] jan dot prachar at gmail dot com Broken since 5.3.0, see https://3v4l.org/paO83 ------------------------------------------------------------------------ [2015-06-04 14:56:10] cmb@php.net Related To: Bug #65211 ------------------------------------------------------------------------ [2015-06-04 14:53:25] cmb@php.net Related To: Bug #53041 ------------------------------------------------------------------------ [2015-06-04 00:00:21] cmb@php.net Considering the amount of closely related bug reports[1], I wouldn't necessarily call that an edge case, Pierre. :) I'll make a PR based on my patch with some tests, if no one beats me to it. [1] I've assembled a maybe non-exhaustive list in <http://news.php.net/php.internals/86301>. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=52065 -- Edit this bug report at https://bugs.php.net/bug.php?id=52065&edit=1

« previous php.bugs (#214154) next »