Symfony1 我得到的是500而不是404

Symfony1 我得到的是500而不是404,symfony1,http-status-code-404,Symfony1,Http Status Code 404,我已经为我的symfony应用程序创建了自定义404错误页面,但它们似乎不起作用。在dev中,我看到: 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/myap

我已经为我的symfony应用程序创建了自定义404错误页面,但它们似乎不起作用。在dev中,我看到:

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
默认/actions/actions.class.php如下所示:

<?php
/**
 * Error page for page not found (404) error
 *
 */

public function executeError404()
{

}

public function executeSecure()
{

}
?>


我跟着我自己找到了答案:D 我忘了文件的一部分:

class defaultActions extends sfActions
{
    public function executeError404() {}
}
如果删除“public”关键字,我会得到:
PHP致命错误:未捕获异常“sfError404Exception”,消息“Action”default/error404“不存在”。