简体   繁体   English

使用app.php的Symfony错误500,在app_dev.php上运行正常

[英]Symfony error 500 with app.php, works fine on app_dev.php

I am currently trying to use our (basic) Symfony 2 app by accessing app.php. 我目前正在尝试通过访问app.php来使用我们的(基本)Symfony 2应用程序。 However, whenever I try to access app.php, I get an error 500. I have checked the logs, the production log is empty. 但是,每当我尝试访问app.php时,都会收到错误500.我检查了日志,生产日志为空。 I have tried the assetic entry in the config file, but to no avail. 我在配置文件中尝试了资产条目,但无济于事。 Anyone else who has any ideas on how to fix this? 谁有任何想法如何解决这个问题?

This is a very basic application (for now), with just some routing changes and a new controller. 这是一个非常基本的应用程序(目前),只有一些路由更改和一个新的控制器。 The most part is html (as a test), so it can't be the php we've written so far. 大部分是html(作为测试),所以它不能是我们迄今为止编写的php。

--edit: I currently do not have the documentroot pointing to the /web directory, but I don't have admin rights on the server. --edit:我目前没有指向/ web目录的documentroot,但我没有服务器的管理员权限。 However, because the app works in app_dev.php, I don't see how this could be a problem? 但是,因为该应用程序在app_dev.php中工作,我不知道这可能是一个什么问题?

The problem also can be caused by changing state of one variable into the web/app.php file from false to true . 也可以通过将一个变量的状态从false更改为true来导致web / app.php文件中的问题。

Check linie: 检查linie:

$kernel = new AppKernel('prod', false);

and change to: 并改为:

$kernel = new AppKernel('prod', true);

I had the same issue, but with setting true: 我有同样的问题,但设置为true:

$kernel = new AppKernel('prod', true); 

I managed to get a readable error message. 我设法得到一个可读的错误消息。 In my case there was a problem with an mysql-table. 在我的情况下,mysql表存在问题。

我通过从我的.yml配置文件中删除一个选项卡并联系serveradmin来将其修改为/ web。

它可能有点晚了,但我今天得到了同样的错误,有助于清除缓存。

I ran into this issue today, and enabling debug mode through AppKernel still didn't show the error. 我今天遇到了这个问题,通过AppKernel启用调试模式仍然没有显示错误。 Turned out I had enabled ApcClassLoader in app.php (just before AppKernel is initialized) but APC wasn't yet enabled on the new environment I deployed to. 原来我在app.php启用了ApcClassLoader (就在AppKernel初始化之前),但是在我部署到的新环境中尚未启用APC。 Commenting the APCClassLoader bit out again in app.php resolved the issue. app.php再次评论APCClassLoader位解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Symfony2 app.php 接收 POST 请求作为 GET app_dev.php 工作正常 - Symfony2 app.php receiving POST request as GET app_dev.php works fine Symfony 2 app.php与app_dev.php - Symfony 2 app.php vs app_dev.php app_dev.php上的Symfony 2.7 500 Internal Server Error - Symfony 2.7 500 Internal Server Error on app_dev.php Symfony2项目-app_dev.php可以工作,但是app.php在特定页面上具有重定向循环 - Symfony2 project - app_dev.php works but app.php has redirect loop on just specific page Dev在app_dev.php中可见,但在app.php中不可见 - Dev visible in app_dev.php but not visible in app.php 从Symfony2中的开发(app_dev.php)到生产(app.php) - From development (app_dev.php) to production (app.php) in Symfony2 Symfony href应该为app_dev.php和app.php工作 - Symfony href shoud work for app_dev.php and app.php Symfony2:在 app.php 和 app_dev.php 之间切换,我这样做对吗? - Symfony2 : Switching between app.php and app_dev.php, am I doing it right? Symfony2:主页可以正确显示在/app_dev.php中,但不能正确显示在/app.php中 - Symfony2: home page displayed properly with /app_dev.php but not with /app.php symfony 2.3 app.php似乎没有使用与app_dev.php相同的树枝 - symfony 2.3 app.php seems not using the same twig as app_dev.php
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM