Yiisoft\Session\SessionException
Failed to start session.
↵
Caused by: Yiisoft\ErrorHandler\ErrorException
session_start(): open(/var/lib/php/sessions/sess_pu15kbejse8125i7sil6utcg3j3lqv6h9an935c6v43ivkrn, O_RDWR) failed: Permission denied (13)
in /path/to/yii-demo/vendor/yiisoft/session/src/Session.php at line 85
vendor/yiisoft/session/src/Session.php -> line 88
If that did not work, change ownership of directory
Found that the dir /var/lib/php/sessions should be owned by the user. Here user means operating system user. Generally in Linux CLI you see sparrow@pearl:/path/to/project: here sparrow is the user. So
I asked: Out of curiosity and to confirm and polish my knowledge about sessions, session in PHP in just the key=>value database stored in plain file in the same operating system PHP is running, am i right?
Samdark:
Kind of.
It’s not the same file all the time.
It creates/modifies multiple files.
each session ID corresponds to a separate file
that is not to have too much locking and concurrency issues