H
H
HexUserHex2020-01-16 19:39:44
linux
HexUserHex, 2020-01-16 19:39:44

Php, session file access error session_start(): Failed to read session data: files?

Good evening,
I have: Centos 7, nginx, php-fpm72, percona, opensips 3.0 I'm trying
to install a web panel to opensips, I ran into a problem that the login and password do not match (I even checked everything from the hashes) Turning on the logs in php saw that there is a problem with access to the directory with sessions:


2020/01/16 17:13:18 [error] 6677#0: *4529 FastCGI sent in stderr: "PHP message: PHP Warning: session_start(): open(/var/nginx/session/sess_ctjmdlpq0v8oo2os5dp4j4c459, O_RDWR) failed: Permission denied (13) in /var/www/domains/opensips-cp/web/main.php on line 22
PHP message: PHP Warning: session_start(): Failed to read session data: files (path: /var/nginx/ session) in /var/www/domains/opensips-cp/web/main.php on line 22" while reading response header from upstream, client: CLIENTIP, server: opensips.com, request: "GET /main.php HTTP/ 1.1", upstream: "fastcgi://unix:/var/run/php72-fpm.sock:", host: "SERVERIP, referrer: " SERVERIP/index.php?err=1 "
2020/01/16 17:16:08 [error] 6676#0: *4553 FastCGI sent in stderr: "PHP message: PHP Warning: session_start(): open(/var/nginx/session/sess_11ti4a0q8dj6ip1uaioolk2leu, O_RDWR) failed: Permission denied (13) in /var/www/domains/opensips-cp/web/login.php on line 22
PHP message: PHP Warning: session_start(): Failed to read session data: files (path: /var/nginx/ session) in /var/www/domains/opensips-cp/web/login.php on line 22" while reading response header from upstream, client: CLIENTIP server: opensips.com, request: "POST /login.php HTTP/1.1 ", upstream: "fastcgi://unix:/var/run/php72-fpm.sock:", host: "SERVERIP", referrer: " SERVERIP/index.php?err=1 "
2020/01/16 17:16:09 [error] 6676#0: *4553 FastCGI sent in stderr: "PHP message: PHP Warning: session_start(): open(/var/nginx/session/sess_gav4f11garfmh3vgcnh7h7s9u7, O_RDWR) failed: Permission denied (13) in /var/www/domains/opensips-cp/web/main.php on line 22
PHP message: PHP Warning: session_start(): Failed to read session data: files (path: /var/nginx/ session) in /var/www/domains/opensips-cp/web/main.php on line 22" while reading response header from upstream, client: CLIENTIP, server: opensips.com, request: "GET /main.php HTTP/ 1.1", upstream: "fastcgi://unix:/var/run/php72-fpm.sock:", host: "SERVERIP", referrer: " SERVERIP/index.php?err=1 "

nginx runs as nginx user:
ps aux
nginx 10550 0.0 0.1 121416 3372 ? S 16:24 0:00 nginx: worker process

php-fpm from root
ps aux

root 10595 0.0 0.7 365568 13308 ? Ss Jan15 0:06 php-fpm: master process (/etc/opt/remi/php72/php-fpm.conf)

I try to put sessions in /var/nginx:
ls -la /var/nginx

drw-rw-rw-2 nginx nginx 6 Jan 16 16:52 session

I tried to give permissions 777 /var/nginx/session/ but to no avail, what am I missing?
session section in phpinfo():

Session Support enabled
Registered save handlers files user
Registered serializer handlers php_serialize php php_binary
Directive Local Value Master Value
session.auto_start Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly 1 1
session.cookie_lifetime 0 0
session.cookie_path //
session.cookie_secure 1 1
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.lazy_write On On
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /var/nginx/session /var/nginx/session
session.serialize_handler php php
session.sid_bits_per_character 5 5
session.sid_length 26 26
session.upload_progress.cleanup On On
session.upload_progress.enabled On On
session .upload_progress.freq 1% 1%
session.upload_progress.min_freq 1 1
session.upload_progress.name PHP_SESSION_UPLOAD_PROGRESS PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix upload_progress_ upload_progress_
session.use_cookies 1 1
session.use_only_cookies 1 1
session.use_strict_use_mode 0_0
session.transid0

Any information you need will be provided as soon as possible...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pliskin, 2020-01-17
@pligin

Usually such a situation when there is not enough disk space

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question