|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-06-10 05:14 UTC] requinix@php.net
-Status: Open
+Status: Duplicate
[2019-06-10 05:14 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 03:00:02 2025 UTC |
Description: ------------ Even if the directory does not exist, you will get the same warning as a path that does not apply to open_basedir. Test script: --------------- <?php $dir_safe = __DIR__.'/dir.' . basename(__FILE__,'.php') . '.safe'; ini_set('open_basedir',"{$dir_safe}/"); file_put_contents("{$dir_safe}/test.txt","shall work"); Expected result: ---------------- Warning: file_put_contents(/FOO/dir.new.safe/test.txt): failed to open stream: No such file or directory in /FOO/test.php on line 4 Actual result: -------------- Warning: file_put_contents(): open_basedir restriction in effect. File(/FOO/dir.new.safe/test.txt) is not within the allowed path(s): (/FOO/dir.new.safe/) in /FOO/new.php on line 4 Warning: file_put_contents(/FOO/dir.new.safe/test.txt): failed to open stream: Operation not permitted in /FOO/new.php on line 4