2016-01-21 50 views
1

當我能夠在app_dev.php調試它拋出500錯誤 這是我app_dev.phpSymfony的2.7 500 app_dev.php內部服務器錯誤

use Symfony\Component\HttpFoundation\Request; 
$loader = require_once __DIR__.'/../app/bootstrap.php.cache'; 
require_once __DIR__.'/../app/AppKernel.php'; 
$kernel = new AppKernel('dev', true); 
$request = Request::createFromGlobals(); 
$response = $kernel->handle($request); 
$response->send(); 
$kernel->terminate($request, $response); 

我真的不知道去哪裏找,我清除了prod和dev緩存。

這是我dev.log報告後,我試圖從開發環境訪問我的域名:如果您使用的是Linux只會發生

[2016-01-21 15:13:44] request.INFO: Matched route "intermediario_list". {"route_parameters":{"_controller":"Talks\\DashboardBundle\\Controller\\IntermediarioController::listAction","_route":"intermediario_list"},"request_uri":"http://devmeter.talksmedia.it/app$ 
[2016-01-21 15:13:44] php.INFO: The Symfony\Component\Form\Extension\Csrf\CsrfProvider\CsrfProviderAdapter class is deprecated since version 2.4 and will be removed in version 3.0. Use the Symfony\Component\Security\Csrf\CsrfTokenManager class instead. {"type":$ 
[2016-01-21 15:13:44] security.DEBUG: Read existing security token from the session. {"key":"_security_main"} [] 
[2016-01-21 15:13:44] doctrine.DEBUG: SELECT t0.username AS username_1, t0.username_canonical AS username_canonical_2, t0.email AS email_3, t0.email_canonical AS email_canonical_4, t0.enabled AS enabled_5, t0.salt AS salt_6, t0.password AS password_7, t0.last_l$ 
[2016-01-21 15:13:44] security.DEBUG: User was reloaded from a user provider. {"username":"manager","provider":"FOS\\UserBundle\\Security\\UserProvider"} [] 
[2016-01-21 15:13:44] security.INFO: No expression found; abstaining from voting. [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelRequest". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\FrameworkBundle\EventListener\SessionListener::onKernelRequest". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\FragmentListener::onKernelRequest". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelRequest". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelRequest". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\HttpKernel\EventListener\TranslatorListener::onKernelRequest". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Component\Security\Http\Firewall::onKernelRequest". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.request" to listener "Symfony\Bundle\AsseticBundle\EventListener\RequestListener::onKernelRequest". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.controller" to listener "Symfony\Bundle\FrameworkBundle\DataCollector\RouterDataCollector::onKernelController". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.controller" to listener "Symfony\Component\HttpKernel\DataCollector\RequestDataCollector::onKernelController". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ControllerListener::onKernelController". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\ParamConverterListener::onKernelController". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelController". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\SecurityListener::onKernelController". [] [] 
[2016-01-21 15:13:44] event.DEBUG: Notified event "kernel.controller" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelController". [] [] 
[2016-01-21 15:13:44] php.INFO: The Symfony\Component\Security\Core\SecurityContext class is deprecated since version 2.6 and will be removed in 3.0. Use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage or Symfony\Component\Security\Cor$ 
[2016-01-21 15:13:44] security.INFO: "hasRole('ROLE_AMMINISTRATORE')" evaluated to true; voting to grant access. [] [] 
[2016-01-21 15:13:44] doctrine.DEBUG: SELECT t0_.id AS id_0, t0_.deletedAt AS deletedAt_1, t0_.percentage AS percentage_2, t0_.name AS name_3, t0_.legalRepresentative AS legalRepresentative_4, t0_.address AS address_5, t0_.email AS email_6, t0_.vatNumber AS vat$ 
[2016-01-21 15:13:45] security.INFO: No expression found; abstaining from voting. [] [] 
[2016-01-21 15:13:45] security.INFO: No expression found; abstaining from voting. [] [] 
[2016-01-21 15:13:45] security.INFO: No expression found; abstaining from voting. [] [] 
[2016-01-21 15:13:45] security.INFO: No expression found; abstaining from voting. [] [] 
[2016-01-21 15:13:45] security.INFO: No expression found; abstaining from voting. [] [] 
[2016-01-21 15:13:45] security.INFO: No expression found; abstaining from voting. [] [] 
[2016-01-21 15:13:45] translation.WARNING: Translation not found. {"id":"Nome:","domain":"messages","locale":"it"} [] 
[2016-01-21 15:13:45] translation.WARNING: Translation not found. {"id":"Email:","domain":"messages","locale":"it"} [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.view" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelView". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\TemplateListener::onKernelView" stopped propagation of the event "kernel.view". [] [] 
[2016-01-21 15:13:45] security.DEBUG: Stored the security token in the session. {"key":"_security_main"} [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bridge\Monolog\Handler\FirePHPHandler::onKernelResponse". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bridge\Monolog\Handler\ChromePhpHandler::onKernelResponse". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ResponseListener::onKernelResponse". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\Security\Http\RememberMe\ResponseListener::onKernelResponse". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.response" to listener "Sensio\Bundle\FrameworkExtraBundle\EventListener\HttpCacheListener::onKernelResponse". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelResponse". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Bundle\WebProfilerBundle\EventListener\WebDebugToolbarListener::onKernelResponse". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\SaveSessionListener::onKernelResponse". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.response" to listener "Symfony\Component\HttpKernel\EventListener\StreamedResponseListener::onKernelResponse". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\LocaleListener::onKernelFinishRequest". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\TranslatorListener::onKernelFinishRequest". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.finish_request" to listener "Symfony\Component\HttpKernel\EventListener\RouterListener::onKernelFinishRequest". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.finish_request" to listener "Symfony\Component\Security\Http\Firewall::onKernelFinishRequest". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.terminate" to listener "Symfony\Bundle\SwiftmailerBundle\EventListener\EmailSenderListener::onTerminate". [] [] 
[2016-01-21 15:13:45] event.DEBUG: Notified event "kernel.terminate" to listener "Symfony\Component\HttpKernel\EventListener\ProfilerListener::onKernelTerminate". [] [] 
+0

您是否使用'使用Symfony \ Component \ HttpFoundation \ Request;'導入'Request'類,...,是啊?另外,請檢查你的error_log。 – Federkun

+0

yes在app_dev.php之上我忘了粘貼它:)沒有在error_log –

+0

'kernel.terminate'被調度的事實讓我覺得你的symfony應用程序工作正常。也許你的網絡服務器的配置?檢查apache的錯誤日誌。 – Federkun

回答

0

此問題。 這與文件的權限有關。我沒有跟蹤確切的文件來更改權限,因爲我急於完成該項目。所以,我只是將web根目錄的內容更改爲777,問題就解決了。

在/ var/www/html /「home_directory」中運行「sudo chmod -R 777 *」。這將解決您的問題。 但是現在你知道這是因爲權限,所以請跟蹤確切的文件,以適當的權限;因爲這個命令從字面上將所有代碼暴露給互聯網。