[英]Nginx and PHP: no write permissions
我在 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中設置的根目錄之外寫入這一事實有關,但我無法修復它。
有人可以幫忙嗎?
非常感謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.