Symfony2 应用程序从 app.php 和 app_dev.php 返回 500 [英] Symfony2 application returning 500 from both app.php and app_dev.php
问题描述
我最近问了这个问题.让我的 symfony 应用程序的生产环境在我的服务器上运行.
I recently asked this question re. getting the production environment of my symfony app to work on my server.
它在我的 domain.com/dev/文件夹中工作.现在我正在尝试将其移动到 domain.com/.
It was working inside my domain.com/dev/ folder. Now I'm trying to move it to just domain.com/.
我首先将所有文件移动到 domain.com/,这意味着该应用程序应该在 domain.com/web/上可用,但在 prod 和 dev 模式下,它返回 HTTP 500 错误代码.我尝试删除和清除缓存但没有结果.
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.
会发生什么?我的服务器满足 Symfony 的所有要求(app/check.php 和 web/config.php).
What could be happening? My server meets all the requirements for Symfony (app/check.php and web/config.php).
最后,我是否应该将应用程序向后移动一步,并将我的服务器配置为查找web"文件夹作为 Web 根目录而不是httpdocs"?
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'?
谢谢.
错误日志给出了这个:
Failed opening required '/var/www/vhosts/mydomain.com/httpdocs/dev/web/../app/bootstrap.php.cache
推荐答案
我已经解决了我的问题.
I've solved my issue.
我重新配置了我的服务器以使用我的 Web 目录作为文档根目录,手动清除缓存,然后使用 --env=prod 参数通过控制台清除.已安装的资产,它完美地运行.:)
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. :)
这篇关于Symfony2 应用程序从 app.php 和 app_dev.php 返回 500的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!