【问题标题】:Symfony version 3 gives 500 server errorSymfony 版本 3 给出 500 服务器错误
【发布时间】:2016-01-05 03:57:55
【问题描述】:

当我在 php 服务器上使用 symfony 2.8 及更低版本时,项目运行良好,但是当我使用 symfony 3 时,我收到 500 服务器错误(该错误不是来自 symfony 错误处理程序,而是来自 Chrome。也没有日志文件缓存)。

为什么我不能使用 Symfony 3。 有来自服务器的 php 配置。 在https://jsfiddle.net/guervyl/o66hsyu4/查看全文

<style type="text/css"> body {
  background-color: #ffffff;
  color: #000000;
}

body,
td,
th,
h1,
h2 {
  font-family: sans-serif;
}

pre {
  margin: 0px;
  font-family: monospace;
}

a:link {
  color: #000099;
  text-decoration: none;
  background-color: #ffffff;
}

a:hover {
  text-decoration: underline;
}

table {
  border-collapse: collapse;
}

.center {
  text-align: center;
}

.center table {
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.center th {
  text-align: center !important;
}

td,
th {
  border: 1px solid #000000;
  font-size: 75%;
  vertical-align: baseline;
}

h1 {
  font-size: 150%;
}

h2 {
  font-size: 125%;
}

.p {
  text-align: left;
}

.e {
  background-color: #ccccff;
  font-weight: bold;
  color: #000000;
}

.h {
  background-color: #9999cc;
  font-weight: bold;
  color: #000000;
}

.v {
  background-color: #cccccc;
  color: #000000;
}

.vr {
  background-color: #cccccc;
  text-align: right;
  color: #000000;
}

img {
  float: right;
  border: 0px;
}

hr {
  width: 600px;
  background-color: #cccccc;
  border: 0px;
  height: 1px;
  color: #000000;
}

</style>
<body>
  <div class="center">
    <table border="0" cellpadding="3" width="600">
      <tr class="h">
        <td>
          <h1 class="p">PHP Version 5.4.41</h1>
        </td>
      </tr>
    </table>
    <br />
    <table border="0" cellpadding="3" width="600">
      <table border="0" cellpadding="3" width="600">
        <tr class="v">
          <td>
            This program makes use of the Zend Scripting Language Engine:
            <br />Zend&nbsp;Engine&nbsp;v2.4.0,&nbsp;Copyright&nbsp;(c)&nbsp;1998-2014&nbsp;Zend&nbsp;Technologies
            <br />&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;the&nbsp;ionCube&nbsp;PHP&nbsp;Loader&nbsp;+&nbsp;Intrusion&nbsp;Protection&nbsp;from&nbsp;ioncube24.com&nbsp;(disabled)&nbsp;v5.0.7,&nbsp;Copyright&nbsp;(c)&nbsp;2002-2015,&nbsp;by&nbsp;ionCube&nbsp;Ltd.
            <br />&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;Zend&nbsp;Guard&nbsp;Loader&nbsp;v3.3,&nbsp;Copyright&nbsp;(c)&nbsp;1998-2013,&nbsp;by&nbsp;Zend&nbsp;Technologies
            <br />
          </td>
        </tr>
      </table>
</div></body>

我的服务器日志:

Mon, 04 Jan 2016 19:46:51 -0500 AH01630: client denied by server configuration: /home/vol12_3/byethost16.com/b16_17125264/mine.byethost16.com/htdocs/src/
Mon, 04 Jan 2016 19:46:51 -0500 AH01630: client denied by server configuration: /home/vol12_3/byethost16.com/b16_17125264/mine.byethost16.com/htdocs/app/
Mon, 04 Jan 2016 19:46:51 -0500 AH00128: File does not exist: /home/vol12_3/byethost16.com/b16_17125264/mine.byethost16.com/htdocs/favicon.ico
Mon, 04 Jan 2016 19:47:35 -0500 AH00128: File does not exist: /home/vol12_3/byethost16.com/b16_17125264/mine.byethost16.com/htdocs/icons/text.gif
Mon, 04 Jan 2016 19:47:46 -0500 AH00128: File does not exist: /home/vol12_3/byethost16.com/b16_17125264/mine.byethost16.com/htdocs/favicon.ico
Mon, 04 Jan 2016 20:45:53 -0500 AH00128: File does not exist: /home/vol12_3/byethost16.com/b16_17125264/mine.byethost16.com/htdocs/web/app_dev.php
Mon, 04 Jan 2016 20:47:51 -0500 AH00128: File does not exist: /home/vol12_3/byethost16.com/b16_17125264/mine.byethost16.com/htdocs/web/

【问题讨论】:

  • 向我们展示您服务器的错误日志。
  • 您的网络服务器不允许访问您的应用程序的源文件,并且找不到很多其他文件。检查您的 Web 服务器配置和相关的文件权限。您是否也真的尝试访问公开服务器上的开发前端控制器?

标签: php symfony


【解决方案1】:

看到您的 HTML 代码,您使用的是 PHP 5.4

实际上,Symfony3 需要 PHP 5.5.9 的最低版本,而 Symfony2 需要 PHP 5.3.9 的最低版本。

我认为这是你的问题。

另外,如果你要升级你的 PHP 版本,我建议你考虑 PHP 7.0。

【讨论】:

  • 7.0 已经存在两个 CVE 安全问题(在 7.0.1 中修复)。跳上最新版本的 PHP 绝不是一个好建议。目前最好的建议是使用 5.6。
  • 谢谢。哪里可以找到需求。我检查了 Sysmfony 要求页面,我有所有,你的答案是正确的。但是我可以访问另一个网站页面以获得更好的要求吗?我知道这是另一个答案,但是 Symfony2.8 需要 PHP 5.3.9 的最低版本,但是当我运行我的 2.8 项目时,我从 Doctrine 收到 T_Class 错误,所以 Object::class 来自 PHP 5.5。为什么会这样。
  • 你好。 Symfony 需求可以在here 找到。关于您的错误,最好打开一个新问题,并提供尽可能多的详细信息
  • 我有 synfony3 在 php 5.4 上工作 - 没有问题。我想我也可以让它在 5.3 上工作(doctrine orm 2.5 取消了对 php 5.3 的支持,但 Doctrine 2.4.8 工作正常)——你只需要更加小心你使用的 php 函数。一般来说,我遇到的唯一问题是完全限定的类名 - 它们很容易修复
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多