nginx on fedora fastcgi not working
The problem you are having is that PHP can't write to the /var/lib/php/session
directory:
PHP message: PHP Warning: session_start(): open(/var/lib/php/session/sess_05tmojugo0peqvoevmlnk4ch36, O_RDWR) failed: Permission denied (13) in /mnt/ext/web/html/panel/include.php on line 52" while reading response header from upstream, client: 92.206.106.243, server: panel.minefight.org, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/www.sock:", host: "panel.minefight.org"
If you look at the permissions of this directory, you will find something like this:
# ls -Zld /var/lib/php/session/
drwxrwx---. 2 system_u:object_r:httpd_var_run_t:s0 root apache 44 May 15 05:26 /var/lib/php/session/
But because you changed php-fpm's user from apache
to management
, the new user can't write to this directory.
To resolve the problem, you can either change the user and group that php-fpm runs as, or change the ownership of /var/lib/php/session
. Be aware that if you do the latter, that the ownership will revert every time you upgrade PHP (as it is embedded into the RPM package) and will need to be corrected again.
I would recommend you set an ACL on this directory, as this won't be disturbed by upgrades. For instance:
setfacl -m u:management:rwx,d:u:management:rwx /var/lib/php/session