我在Ngnix上运行的PHP应用程序(贝加尔湖(Baikal))有问题。该应用程序对其配置文件之一没有(较长)写入权限。升级PHP后可能已发生此问题。
以下是有关我的设置的信息:
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中设置的根目录之外进行写操作,但我无法对其进行修复。
有人可以帮忙吗?非常感谢