PHP/Wordpress 会话配置 [英] PHP/Wordpress Session Configuration

查看:47
本文介绍了PHP/Wordpress 会话配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试集成一个测验/调查插件 使用现有的 Wordpress 站点.一切正常,除了如果用户让测验/调查闲置一段时间(30 分钟足以触发它),他们将在尝试提交回复时收到以下错误消息:

I'm trying to integrate a quiz/survey plugin with an existing Wordpress site. Everything is working well, except that if the user lets a quiz/survey sit idle for awhile (30 minutes is long enough to trigger it) they will be greeted with the following error message when trying to submit their reply:

PHP 会话错误.检查您的会话设置.

PHP Sessions error. Check your sessions settings.

我按照错误消息的提示做了,并检查了我的 PHP 会话设置.更具体地说,我编辑了服务器的 php.ini 文件并将会话超时设置为两个小时.我以为这样可以解决问题,但当我再次测试时,我在 30 分钟不活动后遇到了同样的问题.

I did as the error message suggests and checked my PHP session settings. More specifically, I edited the server's php.ini file and set the session timeout to two hours. I thought that would have done the trick, but when I tested again I got the same issue after 30 minutes of inactivity.

所以我的问题是:

  1. Wordpress 维护的会话是否与 PHP 维护的会话不同?如果是这样,它是如何配置的?
  2. php.ini 是配置我的会话设置的正确位置吗?
  3. 以前有人看到过这个错误吗?如果有,解决方法是什么?
  1. Does Wordpress maintain a session that is different than the one that PHP maintains? If so how is it configured?
  2. Is php.ini the correct place to be configuring my session settings?
  3. Has anyone seen this error before, and if so, what was the solution?

推荐答案

我遇到了同样的问题,

我通过确保 /var/lib/php/session 文件夹设置了 0777 权限来修复它,删除所有会话文件并正常重启服务器.

I fixed it by making sure /var/lib/php/session folder was set 0777 for permissions, deleted all the session files and did a graceful restart of the server.

Sessions 消息消失了,投票成功了.

Sessions messages went away and voting worked.

这篇关于PHP/Wordpress 会话配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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