Symfony 3 shared hosting error 500

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



Symfony 3 shared hosting error 500



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


500



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


src


cpanel



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


URL


example.com/app_dev.php



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:


500


PHP


cpanel


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 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





Does the file at /home/kaftenh1/var/bootstrap.php.cache exist? Note the .. in the path goes upa level, removing public_html from the path
– Milk
Aug 29 '17 at 20:22


/home/kaftenh1/var/bootstrap.php.cache


..


public_html





you can try to chmod 777 for var directory.
– Mehmet Soylu
Aug 29 '17 at 22:03





@Milk thanks alot it worked changed the path
– Suleiman Sani
Aug 30 '17 at 0:45




3 Answers
3



Try run command:



composer install


composer install



Or



php composer.phar install


php composer.phar install



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





Sorry please i am kind of new to the shared hosting. where can i run the command on cpanel. Because i already installed the composer during development
– Suleiman Sani
Aug 29 '17 at 19:06





you can watch tutor
– Imanali Mamadiev
Aug 29 '17 at 19:44



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';



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 .






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS