会话管理的Dev和Prod之间有什么区别?

时间:2013-02-18 18:37:23

标签: session symfony silex

我应该检查什么来解决这个问题?

development中的一切正常,但我的代码是正确的 我的网站提供商(production)给了我这个错误:

RuntimeException: Failed to start the session because headers
have already been sent. in .../vendor/symfony/http   
foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php
line 142

更新1

一旦注册了SessionServiceProvider,我们是否必须手动调用

app["session"]->start()

这是error.log文件的摘录:

[2013-02-18 23:32:36] myapp.INFO: Matched route "GET_hello" (parameters: "_controller": "{}", "_route": "GET_hello") [] []
[2013-02-18 23:32:36] myapp.INFO: Populated SecurityContext with an anonymous Token [] []
[2013-02-18 23:32:36] myapp.INFO: > GET /web/hello [] []
[2013-02-18 23:32:36] myapp.INFO: < 200 [] []
[2013-02-18 23:32:36] myapp.DEBUG: Write SecurityContext in the session [] []
[2013-02-18 23:32:36] myapp.CRITICAL: RuntimeException: Failed to start the session 
because headers have already been sent. (uncaught exception) at 
/home/account/public_html/mydomain.com/vendor/symfony/http-
foundation/Symfony/Component/HttpFoundation/Session/Storage/NativeSessionStorage.php 
line 142 [] []
[2013-02-18 23:32:36] myapp.INFO: < 500 [] []
[2013-02-18 23:32:36] myapp.DEBUG: Write SecurityContext in the session [] []

更新2

我的网站提供商似乎在加载sqlite库时遇到问题。我从Silex文档中注意到sqlite存在依赖性。在我的网站提供商上查看的问题如下:

[18-Feb-2013 23:36:15 UTC] PHP Warning:  PHP Startup: Unable to load 
dynamic library '/usr/local/php54/lib/php/extensions/no-debug-non-zts-20100525/sqlite.so'
- /usr/local/php54/lib/php/extensions/no-debug-non-zts-20100525/sqlite.so: cannot open 
shared object file: No such file or directory in Unknown on line 0

我正在研究这个问题并想知道这个错误是否会阻止Session程序执行它的任务,这可以解决这个问题。

0 个答案:

没有答案