Sunday 10 June 2018

Session Expired, Please login again when using Adminer


I was trying to access the database using adminer.php but I could not able to login, even though I filled in the correct credentials.




The log file gave me the exact issue.

[root@beta-server ]# cat /var/log/nginx/error.log

[error] 24318#24318: *46 FastCGI sent in stderr: "PHP message: PHP Warning:  Unknown: open(/var/lib/php/session/sess_0c6qn562knk0fm7vkil358kr80, O_RDWR) failed: Permission denied (13) in Unknown on line 0
PHP message: PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0" while reading upstream, client: 10.130.12.45, server: example.com, request: "GET /?username=root HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "example.com", referrer: "http://example.com/?username=root"




Solution



These errors occur because PHP has no way of saving sessions on disk.

The location of the PHP session path can be found in "/etc/php.ini" under session.save_path. The default path is /var/lib/php/session. If this directory does not exist, then create it and change permissions on it.

[root@beta-server ]# chmod -R 700 /var/lib/php/session
[root@beta-server ]# chown nginx.nginx -R /var/lib/php/session

After all these changes, i can able to login successfully.


No comments:

Post a Comment