Panel install gives session problem

I have installed the latest kirby starter kit. The installation is working, i can see all the default pages. When I go to the panel install page I see the form but trying to submit it returns me back to the form.
With 'debug',true in the config file I got the following message:

Warning: session_start(): open(/var/lib/php/session/sess_096d73rupkof7utnfof7gs4nd4, O_RDWR) failed: Permission denied (13) in /var/www/vhosts/holmesarchive.com/melgrafik.cuboctaedro.eu/kirby/toolkit/lib/s.php on line 54

Warning: Unknown: open(/var/lib/php/session/sess_096d73rupkof7utnfof7gs4nd4, O_RDWR) failed: Permission denied (13) in Unknown on line 0

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

The session.save path is set to /var/lib/php/session (the default).
The accounts and thumbs folders exist and writable.

Any ideas?

do you have set your folder permissions?, is your account folder
readable?

if you have a Terminal you can just type:

chmod 777 site/accounts

1 Like

This seems to be a permission problem see here and here

1 Like

I have managed to solve it using Kucko’s method, inserting session_save_path(sys_get_temp_dir()) in the toolkit file that handles sessions. It works fine but hacking the toolkit is probably not the best solution.

Just to let you know. The problem (and the solution) remain the same in Kirby 2.4.0

Unfortunately the session_save_path(sys_get_temp_dir()) solution isn’t something we can make the default. It can create very severe security risks if the website is hosted on a shared server and the temp directory is shared as well.

Using this fix is indeed a hack. You should fix it directly in the php.ini or ask your hosting provider to do so. This issue does not only affect Kirby, it affects all PHP CMS.

I have a .user.ini as my site is on a shared host in a large university. I followed @lukasbestle’s advice and set the session.save_path there. One note though, I had to use the full path to the sessions directory in order for it to work (https://stackoverflow.com/a/12722208).