|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2019-01-16 19:38 UTC] daniele dot testa at gmail dot com
[2021-05-03 12:15 UTC] cmb@php.net
-Status: Open
+Status: Duplicate
-Assigned To:
+Assigned To: cmb
[2021-05-03 12:15 UTC] cmb@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 07:00:01 2025 UTC |
Description: ------------ php.ini set to: open_basedir = . Nginx config: location / { root /opt/www/test; fastcgi_pass unix:/run/php/php7.2-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /opt/www/test/index.php; include fastcgi_params; } From documentation: The special value . indicates that the working directory of the script will be used as the base-directory. Trying to GET the PHP-file results in: 2019/01/16 19:06:39 [error] 3013#3013: *9 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/opt/www/test/index.php) is not within the allowed path(s): (.) in Unknown on line 0 Expected result: ---------------- I expect the file to be executed and result sent to client. According to documentation, setting open_basedir to "." should limit the current script to the current directory, but it does not even seem to allow the ACTUAL script to run at all. If I turn off open_basedir and just print the getcwd(), I can clearly see that current dir is /opt/www/test and as the "." setting should allow access to "current dir", it should allow the execution of /opt/www/test/index.php, but it does not. Actual result: -------------- 2019/01/16 19:06:39 [error] 3013#3013: *9 FastCGI sent in stderr: "PHP message: PHP Warning: Unknown: open_basedir restriction in effect. File(/opt/www/test/index.php) is not within the allowed path(s): (.) in Unknown on line 0