Symfony2 application returning 500 from both app.php and app_dev.php

柔情痞子 提交于 2019-12-12 02:05:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!