1

我已经建立了一个在开发环境下完美运行的登录表单。但是一旦我切换到生产环境,就会出现 500 错误。我检查了 prod.log 错误是

Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /bundles/framework/images/input_bg.gif"" at /Users/zhongxingguo/Sites/QuidzOMS/app/cache/prod/classes.php line 1883 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException: No route found for \"GET /bundles/framework/images/input_bg.gif\" .....

我试图删除产品缓存,它没有帮助。而且我还检查了/web/bundles/framework/images 文件夹,没有input_bg.gif。

有人可以帮我吗?

非常感谢。


[2013-07-10 16:36:02] request.CRITICAL: Uncaught PHP Exception RuntimeException: "PDOException was thrown when trying to read the session data: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'pj6krphgnjhj00js435pbr70d5' for key 'PRIMARY'" at /Users/zhongxingguo/Sites/QuidzOMS/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php line 154 {"exception":"[object] (RuntimeException: PDOException was thrown when trying to read the session data: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'pj6krphgnjhj00js435pbr70d5' for key 'PRIMARY' at /Users/zhongxingguo/Sites/QuidzOMS/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php:154, PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'pj6krphgnjhj00js435pbr70d5' for key 'PRIMARY' at /Users/zhongxingguo/Sites/QuidzOMS/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/PdoSessionHandler.php:239)"} []
[2013-07-10 16:36:02] security.DEBUG: Write SecurityContext in the session [] []

现在我认为问题是由 pdoSessionHandler 引起的。我将会话数据存储在数据库中,但有时当用户注销时,会话数据似乎没有被清除。

错误如下:

PDOException was thrown when trying to read the session data: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'jq09f6s8eqvhvpiik322h0kkh1' for key 'PRIMARY'

有谁知道如何解决会话问题?

我的会话配置是:

framework:
    session:
        handler_id:   session.handler.pdo
services:
    pdo:
        class:  pdo
        arguments:
            - "mysql:host=%database_host%;port=%database_port%;dbname=%database_name%"
            - "%database_user%"
            - "%database_password%"
        calls:
            - [setAttribute, [3, 2]]

    session.handler.pdo:
        class:      Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler
        arguments:  ["@pdo", "%pdo.db_options%"]

谢谢大家在这里帮助我。

4

1 回答 1

1

如果您在路径中遇到错误,/bundles/something/whatever我鼓励您确保您的资产是正确的。

键入此命令:

php app/console assets:install --symlink

--no-warmup在我看来,还建议使用参数清除缓存。

如果之后仍然无法正常工作,让我们尝试其他方法。

我希望我能帮助你,伙计;)

于 2013-07-10T06:57:16.180 回答