PHP7 + Symfony 3.1.0 + Vagrant:无法写入会话数据 [英] PHP7 + Symfony 3.1.0 + Vagrant: Failed to write session data

查看:116
本文介绍了PHP7 + Symfony 3.1.0 + Vagrant:无法写入会话数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管普通用户和www-data均可访问路径 /mnt/my-proj/app/../var/sessions/dev 以下消息:

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)

我只能在dev中获得上述消息,而在prod中却没有. /mnt/my-proj/app/../var/sessions/dev /mnt/my-proj/app/../var/sessions/prod 具有相同的要求:777.

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.

上面的路径安装如下:

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

我在做什么错了?

我已阅读以下帖子,但找不到适合我的解决方案:

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

PHP会话处理错误

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

PHP7 + Symfony 2.8,无法写入会话数据

我在Windows 8.1 Enterprice(64位)上使用Vagrant 1.8.1,在Vagrant中使用ubuntu-xenial 16.04.提供程序是VirtualBox 5.0.20.这些设置大部分是默认设置.上面的路径是使用具有完全访问权限的VirtualBox GUI共享的.

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.

亲切的问候,

朱莉

推荐答案

已解决! :-)

设置

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

/mnt/my-proj/app/config/config.yml 中的

解决了该问题.不需要对 /etc/php/7.0/ 中的ini文件进行任何调整(这些文件仍仅具有默认值).

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?

这篇关于PHP7 + Symfony 3.1.0 + Vagrant:无法写入会话数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆