我已阅读有关将我的symfony2应用程序部署到生产环境的食谱。我发现它在开发模式下效果很好,但prod模式首先不允许登录(虽然我使用开发模式中的凭证登录时输入了错误的凭据),但后来经过多次清理和热身后prod缓存,我只是从我的prod路线获取http500。如何部署symfony2 - 我的开发环境工程,但不是生产
我原来在配置文件一看,不知道这有什么关系呢:
config_dev.php:
imports:
- { resource: config.yml }
framework:
router: { resource: "%kernel.root_dir%/config/routing_dev.yml" }
profiler: { only_exceptions: false }
web_profiler:
toolbar: true
intercept_redirects: false
monolog:
handlers:
main:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
firephp:
type: firephp
level: info
assetic:
use_controller: true
config_prod:
imports:
- { resource: config.yml }
#doctrine:
# orm:
# metadata_cache_driver: apc
# result_cache_driver: apc
# query_cache_driver: apc
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: %kernel.logs_dir%/%kernel.environment%.log
level: debug
我还注意到有一个routing_dev.php,但没有routing_prod,prod环境很好,但在我的本地主机,所以......?
框架路由器参数默认是“%kernel.root_dir%/ config/routing.y ML”。 config_dev.yml覆盖它以加载routing_dev.yml,它在加载routing.yml之前加载一些额外的dev路由(用于分析)。所以,不,我不认为这应该是导致你的问题,除非你已经修改了routing_dev.yml并且把你所有的路由导入到那里,而不是路由到.yml – redbirdo
另外,你有没有尝试寻找在Web服务器/ PHP错误日志,看看是否有任何进一步的信息? – redbirdo