我已经构建了一个在开发环境下完美运行的登录表单。但是一旦我切换到生产,就会发生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\" .....
我试图删除prod缓存,但没有帮助。我还检查了/ 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%"]
谢谢大家在这里帮助我。
答案 0 :(得分:1)
如果您在/bundles/something/whatever
这样的路径中收到错误,我建议您确保资产是正确的。
输入以下命令:
php app/console assets:install --symlink
我认为还建议使用--no-warmup
参数清除缓存。
如果在那之后仍然无法正常工作,那就试试吧。
我希望我能帮助你,交配;)