如何让我的Symfony项目进入生产模式


How can I get my Symfony project to production mode?

嗨,我在一家托管公司租了一个域名,我想让我的symfony项目上线。

我在这里使用了指南来做到这一点:将Symfony 2项目转移到托管的步骤?

这给了我一个 500 内部服务器错误。这是我第一次想要部署symfony项目。

我想在 stijnxk59.fiftynine.axc.nl

这是在服务器错误日志中:

[Fri Nov 21 21:15:02 2014] [error] [client 84.198.13.59] Directory index forbidden by Options directive: /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/public_html/
[Fri Nov 21 21:15:02 2014] [error] [client 84.198.13.59] File does not exist: /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/public_html/403.shtml
[Fri Nov 21 21:23:03 2014] [error] [client 84.198.13.59] Directory index forbidden by Options directive: /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/public_html/
[Fri Nov 21 21:23:03 2014] [error] [client 84.198.13.59] File does not exist: /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/public_html/403.shtml
[Fri Nov 21 22:29:51 2014] [error] [client 84.198.13.59] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 22:29:51 2014] [error] [client 84.198.13.59] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 22:30:10 2014] [error] [client 84.198.13.59] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 22:30:10 2014] [error] [client 84.198.13.59] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 22:37:05 2014] [error] [client 84.198.13.59] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 22:37:05 2014] [error] [client 84.198.13.59] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 23:42:16 2014] [error] [client 108.181.126.202] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: https://stackoverflow.com/questions/27071583/how-can-i-get-my-symfony-project-to-production-mode
[Fri Nov 21 23:42:16 2014] [error] [client 108.181.126.202] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: https://stackoverflow.com/questions/27071583/how-can-i-get-my-symfony-project-to-production-mode
[Fri Nov 21 23:42:16 2014] [error] [client 108.181.126.202] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 23:42:16 2014] [error] [client 108.181.126.202] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 23:42:16 2014] [error] [client 108.181.126.202] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 23:42:16 2014] [error] [client 108.181.126.202] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Fri Nov 21 23:42:25 2014] [error] [client 182.118.26.147] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://stijnxk59.fiftynine.axc.nl/
[Fri Nov 21 23:42:25 2014] [error] [client 182.118.26.147] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://stijnxk59.fiftynine.axc.nl/
[Sat Nov 22 13:45:28 2014] [error] [client 84.197.200.66] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Sat Nov 22 13:45:28 2014] [error] [client 84.197.200.66] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

我将我的网络目录重命名为 public_html,当我尝试访问该网站时,现在我得到:

Fatal error: Uncaught exception 'UnexpectedValueException' with message 'The stream or file "C:/wamp/www/SocProNetbeans/app/logs/prod.log" could not be opened: fopen(C:/wamp/www/SocProNetbeans/app/logs/prod.log) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: No such file or directory' in /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php:4987 Stack trace: #0 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php(4931): Monolog'Handler'StreamHandler->write(Array) #1 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php(4856): Monolog'Handler'AbstractProcessingHandler->handle(Array) #2 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php(5056): Monolog'Handler'AbstractHandler->handleBatch(Array) #3 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php(5361): Monolog'Handler'FingersCrossedHandler->handle(Array) #4 /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/cl in /home/stijnxk59/domains/stijnxk59.fiftynine.axc.nl/app/cache/prod/classes.php on line 4987

有很多可能性,需要更多的案例细节。

  • 我打赌日志和缓存文件夹中缺少权限
  • 检查服务器日志或 Symfony 日志