gpt4 book ai didi

php - Vagrant : Unable to create sessions, 缓存中的 Cakephp,缓存模型

转载 作者:搜寻专家 更新时间:2023-10-31 21:58:42 25 4
gpt4 key购买 nike

我一直在尝试在配备 Apache2、mysql、neo4j 的 vagrant box 中运行 Cakephp 应用程序,应用程序运行所需的一切。该站点正在打开,当我尝试在本地登录时,出现了这些错误。

这是调试日志:

2015-06-29 19:04:38 Warning: Warning (512): /vagrant/app/tmp/cache/ is not writable in [/vagrant/cake/libs/cache/file.php, line 267]

2015-06-29 19:04:38 Warning: Warning (512): /vagrant/app/tmp/cache/persistent/ is not writable in [/vagrant/cake/libs/cache/file.php, line 267]

2015-06-29 19:04:38 Warning: Warning (512): /vagrant/app/tmp/cache/models/ is not writable in [/vagrant/cake/libs/cache/file.php, line 267]

2015-06-29 19:04:38 Warning: Warning (2): session_start(): open(/vagrant/app/tmp/sessions/sess_ojvjndme1tqt1bn4dnra8erq96, O_RDWR) failed: Permission denied (13) in [/vagrant/cake/libs/cake_session.php, line 587]

2015-06-29 19:04:38 Warning: Warning (2): Unknown: open(/vagrant/app/tmp/sessions/sess_ojvjndme1tqt1bn4dnra8erq96, O_RDWR) failed: Permission denied (13) in [Unknown, line 0]

2015-06-29 19:04:38 Warning: Warning (2): Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/vagrant/app/tmp/sessions) in [Unknown, line 0]

2015-06-29 19:04:49 Warning: Warning (2): session_start(): open(/vagrant/app/tmp/sessions/sess_p2utf2okm73g71cv2ed361a8c7, O_RDWR) failed: Permission denied (13) in [/vagrant/cake/libs/cake_session.php, line 587]

2015-06-29 19:04:49 Warning: Warning (2): session_write_close(): open(/vagrant/app/tmp/sessions/sess_p2utf2okm73g71cv2ed361a8c7, O_RDWR) failed: Permission denied (13) in [/vagrant/cake/libs/controller/controller.php, line 694]

我打开了所有权限(通过在 ./tmp 文件夹中执行“sudo chmod -R 777 .”)对/tmp 中的所有文件夹,但错误仍然存​​在。不确定为什么应用程序无法在 tmp 目录中创建新的 session 文件。

Edits & New developments :所以,我意识到当代码与主机和 vagrant guest 操作系统共享时,代码中的 tmp 文件夹实际上已挂载,这可能是原因对于未授予权限的错误。

现在问题已简化为如何在/vagrant/文件夹之外创建一个“tmp”文件夹,并将所有日志、缓存、 session 等写入虚拟操作系统文件系统内的外部文件夹?

我尝试使用以下建议:http://singletonio.blogspot.in/2009/01/changing-tmp-directory-of-cakephp-so-it.html

但是,新的日志、 session 没有写在 ~/tmp 上(这是我设置缓存、 session 、日志文件夹的地方)?

你能帮帮我吗?

最佳答案

我所做的是将开发服务器中的 Apache 用户从“www-data”更改为“vagrant”。

编辑/etc/apache2/envvars:

export APACHE_RUN_USER=vagrant
export APACHE_RUN_GROUP=vagrant

关于php - Vagrant : Unable to create sessions, 缓存中的 Cakephp,缓存模型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31117266/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com