php - Nginx 和 PHP:没有写权限
问题描述
我对在 Ngnix 上运行的 PHP 应用程序(Baikal)有疑问。该应用程序对其配置文件之一没有(不再)写入权限。升级 PHP 后可能会出现此问题。
以下是有关我的设置的一些信息:
- 操作系统:Arch Linux
- Nginx 版本:1.16.1
- Nginx 用户:http
- PHP版本:7.4.1
- 应用:贝加尔湖0.4.6
- Nginx 配置:
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name –––––––––;
root /usr/share/webapps/baikal/html;
index index.php;
include include/ssl.conf;
include include/letsencrypt.conf;
rewrite ^/.well-known/caldav /dav.php redirect;
rewrite ^/.well-known/carddav /dav.php redirect;
charset utf-8;
location ~ /(\.ht|Core|Specific) {
deny all;
return 404;
}
location ~ ^(.+\.php)(.*)$ {
try_files $fastcgi_script_name =404;
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
应用程序报告文件Specific/config.php不可写。完整路径是/usr/share/webapps/baikal/Specific/config.php。
出于测试目的,我已将文件的权限设置为 777;没有成功。我测试了 PHP 函数is_writable
。它返回false
该文件。fopen
表示文件系统是只读的(不是)。
我已经阅读了很多关于 SELinux 防止写入操作的内容,但正如我所说,我使用的是 Arch Linux,它不是 SELinux。
我认为这与不允许 PHP 在 Nginx 中设置的根目录之外写入的事实有关,但我无法修复它。
有人可以帮忙吗?
非常感谢
解决方案
推荐阅读
- asp.net - 如何使用多个 API 将 swagger 设置为项目?
- javascript - 如何一个接一个地调用两个异步函数?
- python - 硒用python打开后无法获取页面
- java - 为什么不建议在循环中更改字符串?推荐使用什么?
- python - 不确定 Shell 命令的类型
- javascript - 如何在子组件中调用反应上下文更新功能?
- php - 将用 C 编写的给定 CRC 16 代码转换为 PHP
- excel - 用于检索网站数据的 vba 代码不适用于 tls1.3。我能做些什么?
- javascript - 数组文字符号 [] 是可取的
- streaming - 使兄弟节点在流模式下具有父节点