Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP7 + Symfony 3.1.0 + Vagrant: Failed to write session data

although the path /mnt/my-proj/app/../var/sessions/dev is accessible for both the normal user and www-data I get the following message:

Warning: session_write_close(): Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/mnt/op-accounting2/app/../var/sessions/dev)

I get the message above only in dev, but not in prod. /mnt/my-proj/app/../var/sessions/dev and /mnt/my-proj/app/../var/sessions/prod have the same pemissions: 777.

The path above is mounted as following:

# mount -t vboxsf -o uid=1000,gid=33,umask=000 my-proj /mnt/my-proj;

What am I doing wrong?

I've read the following posts, but could find no solution for me:

PHP session handling errors

https://github.com/NewEraCracker/suhosin-patches/issues/3

PHP7 + Symfony 2.8, Failed to write session data

I'm using Vagrant 1.8.1 on Windows 8.1 Enterprice (64Bit) and ubuntu-xenial 16.04 in Vagrant. The provider is VirtualBox 5.0.20. The settings are mostly default ones. The path above is shared using VirtualBox GUI with full access.

Kind regards,

Juri

like image 243
Juri Sinitson Avatar asked Oct 30 '22 02:10

Juri Sinitson


1 Answers

SOLVED! :-)

Setting

save_path:   "/var/lib/php/sessions"

in /mnt/my-proj/app/config/config.yml solved the problem. Any adjusting of ini-Files in /etc/php/7.0/ wasn't neccessary (those files have still default values only).

But I wander why didn't I get that error message in prod?

like image 96
Juri Sinitson Avatar answered Nov 09 '22 13:11

Juri Sinitson