cakephp flash 消息在 apache 服务器上消失

cakephp flash messages dissapearing on apache server

在这里卡了几个小时!

我使用的是 cakephp 2.4.4,并且我有非常标准的带有 flash 消息的重定向。出于某种原因,Flash 消息没有出现在我的生产服务器上(运行 apache)?!如果我注释掉重定向,则会出现 flash 消息。

我的应用程序似乎在我的开发服务器(运行 nginx)上完美运行。

有没有人有什么想法?

$this->Session->setFlash(__('The User -'.$e["User"]['name'].'('.$e["User"]['resource_payroll_number'].') - Has been Activated'), 'alert', array('class' => 'alert-success'));

$this->redirect(array('action' => 'index'));

这一定是因为你的调试级别。检查 core.php 文件。

/**
* CakePHP Debug Level:
*
* Production Mode:
* 0: No error messages, errors, or warnings shown. Flash messages redirect.
*
* Development Mode:
* 1: Errors and warnings shown, model caches refreshed, flash messages halted.
* 2: As in 1, but also with full debug messages and SQL output.
*
* In production mode, flash messages redirect after a time interval.
* In development mode, you need to click the flash message to continue.
*/
Configure::write('debug', 2);

这是复制的from github cakephp