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

From: Date: Tue, 02 Oct 2018 05:08:44 +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-217343@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: sriccio at swisscenter 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: We're seeing this in all the PHP versions we use (5.6, 7.0, 7.1, 7.2). Literally spent hours trying to understand why we have these warning even that the paths are allowed in the open_basedir directive. Finally it was because the parent dir of a path was in fact a file and not a dir. The warning message is really misleading... It would really be nice to fix this Previous Comments: ------------------------------------------------------------------------ [2018-09-02 20:55:47] requinix@php.net Related To: Bug #76836 ------------------------------------------------------------------------ [2018-08-03 21:12:43] requinix@php.net Related To: Bug #76701 ------------------------------------------------------------------------ [2018-02-28 22:26:06] a19836 at gmail dot com 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 ------------------------------------------------------------------------ [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 ------------------------------------------------------------------------ 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 (#217343) next »