php 长时间闲置的phpmyadmin令牌不匹配

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18076499/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:56:40  来源:igfitidea点击:

phpmyadmin token mismatch for long time idle

phpapachesessionphpmyadminsession-cookies

提问by Arash Mousavi

I installed phpMyAdmin 4.0.4.1on my local develop enviroment, I set auth_typeto config. Also I provide authentication requirements by this settings:

我安装phpMyAdmin 4.0.4.1在我的本地开发环境中,我设置auth_typeconfig. 我还通过此设置提供身份验证要求:

$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['password'] = 'somepassword';

But after a while that it is idle, if I click on any link of it , it shows me an error token mismatch, Is there any way that I increase its TTL? or make it alive permanently?

但是一段时间后它闲置了,如果我点击它的任何链接,它会显示一个错误token mismatch,有什么办法可以增加它的TTL吗?还是让它永远活着?

enter image description here

在此处输入图片说明

Above picture shows error.

上图显示错误。

回答by jmarceli

I solve this annoying problem by following instructions below:

我按照以下说明解决了这个烦人的问题:

  1. open /etc/php5/apache2/php.ini
  2. find ;session.save_path = "/tmp", this line may look also like this ;session.save_path = "/var/lib/php5"
  3. remove first semicolon from this line
  4. restart apache by executing sudo service apache2 restart
  1. 打开 /etc/php5/apache2/php.ini
  2. find ;session.save_path = "/tmp", 这一行也可能是这样的;session.save_path = "/var/lib/php5"
  3. 从此行中删除第一个分号
  4. 通过执行重新启动apache sudo service apache2 restart

FYI: I work under Ubuntu 12.04 with apache2, php5, phpMyAdmin 4.0.5 so for different systems and servers file path may be a little different.

仅供参考:我在 Ubuntu 12.04 和 apache2、php5、phpMyAdmin 4.0.5 下工作,因此对于不同的系统和服务器,文件路径可能略有不同。

In case of any troubles check if directory from step 2.is writable for server.

如果出现任何问题,请检查步骤中的目录2.是否可用于服务器。

Good luck.

祝你好运。

回答by adolfjap

in file libraries/common.inc.php

在文件中 libraries/common.inc.php

line 1076
delete this part

第 1076 行
删除此部分

 /*
 * There is no point in even attempting to process
 * an ajax request if there is a token mismatch
 */
 if (isset($response) && $response->isAjax() && $token_mismatch) {
    $response->isSuccess(false);
    $response->addJSON(
        'message',
        PMA_Message::error(__('Error: Token mismatch'))
    );
    exit;
}

回答by leeb

For me this seemed to be caused by my root partition being full up, and I guess this error was triggered by php being unable to write to the session directory.

对我来说,这似乎是由我的根分区已满引起的,我猜这个错误是由 php 无法写入会话目录引起的。

回答by Ronny Sherer

After doing all that was recommended here and in other places with no success, I found out that my /tmp was full.

在做了这里和其他地方推荐的所有操作但没有成功后,我发现我的 /tmp 已满

To check it, just run from command line: df

要检查它,只需从命令行运行: df

It reports file system disk space usage.

它报告文件系统磁盘空间使用情况。

回答by thespacecadette

I had to turn my cookies on in my browser and it worked for me. (Using MAMP on OSX)

我不得不在我的浏览器中打开我的 cookie,它对我有用。(在 OSX 上使用 MAMP)

回答by Roy Asoolin

In my case I had to remove some files to make some space in this directory (\tmp) and the error was gone for now.

就我而言,我不得不删除一些文件以在此目录 (\tmp) 中腾出一些空间,并且错误暂时消失了。

回答by Chit

Clearing your browser cache then it will work.

清除浏览器缓存然后它会起作用。

回答by Seid

Try using another browser ex IE if it works then remove suspected chrome extensions . Forr me pageXray was the problem.

尝试使用其他浏览器 ex IE 如果它工作然后删除可疑的 chrome 扩展。对于我而言,pageXray 是问题所在。

回答by user3247391

ISSUE RESOLVED - I just cleared the browsing history and data for last 7 days. It solved the problem for me. Try it.

问题已解决 - 我刚刚清除了过去 7 天的浏览历史记录和数据。它为我解决了这个问题。尝试一下。

回答by JacobRocks12

To stop this issue, delete the "tmp" folder and make a new one called "tmp" or just clear the content.

要停止此问题,请删除“ tmp”文件夹并创建一个名为“ tmp”的新文件夹,或者只是清除内容。