Symfony looks for app folder in wrong place

Viewed 611

My Symfony 3.3 application is looking for app folder in wrong place.

I deployed Symfony 3.3 project to a subdomain (subdomain.domain.com). Subdomain folder location on server is: /home/USERNAME/public_html/PROJECTNAME Subdomain document root is: /home/USERNAME/public_html/PROJECTNAME/web

This is normal Symfony folder structure, nothing changed. Why it doesn't look for app folder in correct place? What am I missing?

Error I get is:

request.CRITICAL: Uncaught PHP Exception Symfony\Component\Config\Exception\FileLocatorFileNotFoundException: "The file "/home/USERNAME/public_html/app/config/routing.yml" does not exist." at /home/USERNAME/public_html/PROJECTNAME/var/cache/prod/classes.php line 3040 {"exception":"[object] (Symfony\\Component\\Config\\Exception\\FileLocatorFileNotFoundException(code: 0): The file \"/home/USERNAME/public_html/app/config/routing.yml\" does not exist. at /home/USERNAME/public_html/PROJECTNAME/var/cache/prod/classes.php:3040)"} []

EDIT:

I found out that composer.json was not in the correct folder. I posted that as an answer and accepted it.

3 Answers

The error message gives you the clue, I don't know how you browse your site, but Symfony tries to find the file from your root folder, I guess you are trying to browse as a domain.if it is subdomain then URL should be like this SubDomainFolderName.DomainName

Or try to solve this using .htaccess

You should run bin/console cache:clear command after deploy.

And what about the content of getCacheDir method in AppKernel?

Should be:

return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
Related