2017-08-29 103 views
2

我試圖在共享主機上部署我的交響樂應用程序,但我不斷收到錯誤500Symfony 3共享主機錯誤500

我在父文件夾中構建應用程序,bin,src和供應商,然後我將web文件夾更改爲public_html,文件號爲cpanel

當我運行URL使用example.com/app_dev.php它工作正常。

然而,當使用例如我得到錯誤500,所以我切換上cpanelPHP選項display_error,這是我得到的錯誤:

Warning: include_once(/home/kaftenh1/public_html/../var/bootstrap.php.cache): failed to open stream: No such file or directory in /home/kaftenh1/public_html/app.php on line 7

Warning: include_once(): Failed opening '/home/kaftenh1/public_html/../var/bootstrap.php.cache' for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in /home/kaftenh1/public_html/app.php on line 7

Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: The service "elao.error_notifier.listener" has a dependency on a non-existent service "swiftmailer.mailer.notifier". in /home/kaftenh1/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php:58 Stack trace: #0 /home/kaftenh1/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(42): Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processReferences(Array) #1 /home/kaftenh1/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(36): Symfony\Component\DependencyInjection\Compiler\CheckExceptionOnInvalidReferenceBehaviorPass->processDefinition(Object(Symfony\Component\DependencyInjection\Definition)) #2 /home/kaftenh1/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compi in /home/kaftenh1/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php on line 58

感謝

+0

'/ home/kaftenh1/var/bootstrap.php.cache'文件是否存在?請注意路徑中的'..'進入upa級別,從路徑 – Milk

+0

中刪除'public_html',您可以嘗試對var目錄chmod 777。 –

+0

@Milk非常感謝它的工作改變了路徑 –

回答

0

嘗試運行命令:

composer install

php composer.phar install

我希望這個視頻教程你的幫助。 https://www.youtube.com/watch?v=HchMW8EhWPU

+0

對不起,請讓我對共享主機有所瞭解。我可以在哪裏運行cpanel上的命令。因爲我在開發期間已經安裝了作曲家 –

+0

,所以你可以看導師 –

0

如果你有到服務器,那麼你可以登錄到服務器並打開該網站項目,並運行

composer install 

如果你沒有SSH訪問嘗試使用webconsole ssh訪問。

0

謝謝大家。萬分感激。從你的回答和評論中,我發現問題是什麼。我改變了app.php中的路徑以指向bootstrap.php.cache所在的位置。

<?php 

use Symfony\Component\HttpFoundation\Request; 

/** @var \Composer\Autoload\ClassLoader $loader */ 
$loader = require __DIR__.'/../app/autoload.php'; 
include_once '/home/kaftenh1/var/bootstrap.php.cache';