я бегу nginx 1.16.1
с php 7.4.0
на Manjaro KDE 18.1.4
.
У меня есть очень похожая установка на чистом arch Linux arm
, где следующая настройка работает без проблем.
Я попытался настроить проект yii2, который показывает следующую ошибку при вводе ig-net.at
:
Каталог недоступен для записи веб-процессом
or
Не удалось создать каталог "/usr/share/nginx/html/ig-net/runtime": mkdir(): файловая система только для чтения
Журнал ошибок nginx показывает следующую ошибку:
FastCGI отправил в stderr: «Сообщение PHP: Предупреждение PHP: mkdir(): Только для чтения
Папка html, в которой находится веб-сайт, находится под /usr/share/nginx/html/
и соответствующим образом изменены разрешения.
chmod -R g+w /usr/share/nginx/html/
chgrp -R http /usr/share/nginx/html/
chown -R http /usr/share/nginx/html/
Оба процесса nginx и php-fpm работают под пользователем http
.
ps aux | grep nginx
и ps aux | grep php-fpm
возвращают следующее:
root 6294 0.0 0.0 11868 1252 ? Ss 15:33 0:00 nginx: master process /usr/bin/nginx -g pid /run/nginx.pid; error_log stderr;
http 6295 0.0 0.0 12496 4352 ? S 15:33 0:00 nginx: worker process
root 3393 0.0 0.3 88140 26844 ? Ss 14:15 0:00 php-fpm: master process (/etc/php/php-fpm.conf)
http 3395 0.0 0.2 92988 19512 ? S 14:15 0:00 php-fpm: pool www
http 3396 0.0 0.2 92988 19776 ? S 14:15 0:01 php-fpm: pool www
файл конфигурации nginx выглядит так
user http;
worker_processes 1;
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite /.* /index.php;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_read_timeout 180;
}
location ~ /\.ht {
deny all;
}
}
server {
listen 80;
listen [::]:80;
server_name ig-net.at;
root /usr/share/nginx/html/ig-net/web;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite /.* /index.php;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
fastcgi_read_timeout 180;
}
}
}
Я также пытался создать папку с в терминале с пользователем http
, и это сработало без проблем.
Так в чем проблема с веб-процессом, работающим некорректно?
Спасибо, Люк
http
пользователю/группе разрешено писать туда только. - person Luc   schedule 29.12.2019