arcy 发表于 2023-2-6 15:38:20

1.9设置.user.ini无效


[*]fastcgi.conf已注解fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
[*]使用laravel框架,root设置为:/path/public
[*].user.ini设置为:open_basedir=/path/:/tmp/:/proc/
[*]重启nginx


仍然提示
(看附件)

后来把fastcgi.conf的注解去掉,改成fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/wwwroot/:/tmp/:/proc/";
这样的配置是生效的

怀疑:
是不是有其他地方设置了open_basedir?

之前使用1.7的时候,这样配置是生效的,现在注解了,但不生效。

arcy 发表于 2023-2-6 15:41:49

2023/02/06 15:26:52 269825#0: *11 FastCGI sent in stderr: "PHP message: PHP Warning:file_exists(): open_basedir restriction in effect. File(/home/wwwroot/path/public/../storage/framework/maintenance.php) is not within the allowed path(s): (/home/wwwroot/path/public/:/tmp/:/proc/) in /home/wwwroot/path/public/index.php on line 19PHP message: PHP Warning:require(): open_basedir restriction in effect. File(/home/wwwroot/path/vendor/autoload.php) is not within the allowed path(s): (/home/wwwroot/path/public/:/tmp/:/proc/) in /home/wwwroot/path/public/index.php on line 34PHP message: PHP Warning:require(/home/wwwroot/path/vendor/autoload.php): Failed to open stream: Operation not permitted in /home/wwwroot/path/public/index.php on line 34PHP message: PHP Fatal error:Uncaught Error: Failed opening required '/home/wwwroot/path/public/../vendor/autoload.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/path/public/index.php:34

arcy 发表于 2023-2-6 18:47:12

重启服务器,正常了。。

arcy 发表于 2023-2-6 18:47:57

是不是有缓存的情况?

licess 发表于 2023-2-6 20:09:05

.user.ini 是 php-fpm 控制的,需要重启 php-fpm 才生效
页: [1]
查看完整版本: 1.9设置.user.ini无效