我已经建立了一个在开发环境下完美运行的登录表单。但是一旦我切换到生产环境,就会出现 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%"]
谢谢大家在这里帮助我。