【发布时间】:2011-02-23 15:54:23
【问题描述】:
我为我的 symfony 应用程序创建了自定义 404 错误页面,但它们似乎不起作用。在开发中我看到:
This request has been forwarded to a 404 error page by the action "blabla".
但在 prod 中,页面只是空白;我收到 500 错误。
在日志中,错误是:
PHP Parse error: syntax error, unexpected T_PUBLIC in /var/www/myproject/apps/myapp/modules/default/actions/actions.class.php on line 7
default/actions/actions.class.php 如下:
<?php
/**
* Error page for page not found (404) error
*
*/
public function executeError404()
{
}
public function executeSecure()
{
}
?>
【问题讨论】:
-
如果我删除“公共”关键字,我会得到:
PHP Fatal error: Uncaught exception 'sfError404Exception' with message 'Action "default/error404" does not exist.'
标签: symfony1 http-status-code-404