r/PHPhelp • u/rp_001 • Jan 15 '25
Failed to write session data
Hi Team,
I use a monitoring tool called Zabbix, whch uses PHP
When importing templates, i get the error "Unexpected server error"
I do see this error in the apache error log:
PHP Warning: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/lib/php/sessions) in Unknown on line 0,
php version = 8.2
current permissions and owner ship of /var/lib/php/sessions
owner: root
group: root
Permissions: drwx-wx-wt
I tied:
- changing permissions on the session.save_path folder to 777
- changing the ownership to the www-data:www-data (under which apache runs)
- changing the path to /tmp, which is 777
Nothing worked.
At a bit of a loss as to what to do now.
thanks for any assistance.
View all comments
Show parent comment
1
u/rp_001 Jan 16 '25
thanks for the reply.
I restarted apache and changed the correct ini, I believe. I will have another look. certainly, phpinfo reported teh changed path when changed to /tmp
however, changing permissions or ownership woudl be independent of the ini file in question as long as I changed the correct session save path. I used phpinfo to check that.
re: read permissions or not
i left it as the default and I read that 777 would be a security rick.
it is a conundrum