问题
I recently asked this question re. getting the production environment of my symfony app to work on my server.
It was working inside my domain.com/dev/ folder. Now I'm trying to move it to just domain.com/.
I first moved all the files to domain.com/ which means the app should be available at domain.com/web/, but in both prod and dev modes it returns a HTTP 500 error code. I tried deleting and clearing the cache with no results.
What could be happening? My server meets all the requirements for Symfony (app/check.php and web/config.php).
And lastly, should I be moving the app one step further back, and configuring my server to look for the 'web' folder as the web root rather than 'httpdocs'?
Thanks.
EDIT:
Error log is giving this:
Failed opening required '/var/www/vhosts/mydomain.com/httpdocs/dev/web/../app/bootstrap.php.cache
回答1:
You shouldn't put your whole project under httpdocs. Only the web directory should be public.
Did you run composer install? bootstrap.php.cache is generated by one of the post-install handlers.
回答2:
I've solved my issue.
I reconfigured my server to use my web directory as the document root, manually cleared cache, then cleared via console with the --env=prod argument. Installed assets and it's working live perfectly. :)
来源:https://stackoverflow.com/questions/14828294/symfony2-application-returning-500-from-both-app-php-and-app-dev-php