skip to Main Content

I am trying to deploy my symphony application on a shared hosting but I keep getting error 500.

I structured the app, bin, src and vendor on the parent folder then I changed the web folder to public_html on cpanel.

when I run the URL using example.com/app_dev.php it works fine.

However when use example.com i get error 500, so I toggled the PHP option on cpanel to display_error and this is the error I am getting:

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 SymfonyComponentDependencyInjectionExceptionServiceNotFoundException: 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): SymfonyComponentDependencyInjectionCompilerCheckExceptionOnInvalidReferenceBehaviorPass->processReferences(Array) #1 /home/kaftenh1/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Compiler/CheckExceptionOnInvalidReferenceBehaviorPass.php(36): SymfonyComponentDependencyInjectionCompilerCheckExceptionOnInvalidReferenceBehaviorPass->processDefinition(Object(SymfonyComponentDependencyInjectionDefinition)) #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

Thanks for

3

Answers


  1. Chosen as BEST ANSWER

    Thanks everyone. Really appreciate. From your answer and comments i figured the what the problem was. I changed the path in app.php to point where the bootstrap.php.cache is.

    <?php
    
    use SymfonyComponentHttpFoundationRequest;
    
    /** @var ComposerAutoloadClassLoader $loader */
     $loader = require __DIR__.'/../app/autoload.php';
    include_once '/home/kaftenh1/var/bootstrap.php.cache';  
    

  2. Try run command:

    composer install

    Or

    php composer.phar install

    I hope this video tutorial help you.
    https://www.youtube.com/watch?v=HchMW8EhWPU

    Login or Signup to reply.
  3. If you have ssh access to the server you can then login to the server and open the website project and run

     composer install
    

    If you dont have ssh access try to use webconsole .

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search