【问题标题】:APC causing an HTTP 500 error code under symfony executed through php5-cgiAPC在通过php5-cgi执行的symfony下导致HTTP 500错误代码
【发布时间】:2012-04-12 10:23:15
【问题描述】:

我目前正在通过 mod_fastcgi 执行 PHP(当然是在 Apache 下),当我在 php.ini 配置文件中启用 APC 时,symfony 会随机抛出 500 错误。

当我在 Apache 重新启动后第一次调用 app.phpapp_dev.php 时,它工作正常,但是,任何后续重新加载都会导致 500 错误。

这是来自 Apache 的一些日志,

FastCGI: incomplete headers (0 bytes) received from server "/var/www/bin/php-fastcgi"
Connection reset by peer: [client ******:18656] FastCGI: comm with server "/var/www/bin/php-fastcgi" aborted: read failed
FastCGI: incomplete headers (0 bytes) received from server "/var/www/bin/php-fastcgi"

/var/www/bin/php-fastcgi 是我的包装器:

#!/bin/sh

PHP_FCGI_CHILDREN=5
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=500
export PHP_FCGI_MAX_REQUESTS

umask 0022
exec /usr/local/bin/php-cgi -d apc.shm_size=16M

如果您有任何线索,请告诉我,任何帮助将不胜感激!

更新:如果需要,这是我的phpinfo()https://pobourgeois.com/?phpinfo

Update2:我认为我的问题可能出在 symfony 中,因为我所有其他网站都加载正常。使用 APC 时是否需要在 Sympfony 中进行任何特殊配置?

【问题讨论】:

  • 您使用的是来自 svn 的最新 APC 吗?我记得有一个讨厌的错误,尚未在发行版中修复,但只有 svn。
  • 我通过pecl安装了APC,这里是安装命令的输出:pecl/apc is already installed and is the same as the released version 3.1.9我会尝试从trunk编译最新版本。

标签: php apache symfony1 fastcgi


【解决方案1】:

我通过直接从 SVN 编译 APC 自己设法解决了这个问题。 (非常感谢 Maerlyn!)

如果有人遇到同样的问题,请按照以下步骤使所有内容协同工作:

$ svn co http://svn.php.net/repository/pecl/apc/trunk/ apc-trunk
$ cd apc-trunk/
$ ./configure --enable-apc --with-php-config=/usr/local/bin/php-config
$ make
$ make test (optional)
$ make install

另外,不要忘记在 php.ini 文件中加载新扩展并重新启动网络服务器。

就是这样!

【讨论】:

    【解决方案2】:

    对我来说

    $ phpize
    $ ./configure
    不见了

    它修复了我的错误 symfony2 500 Apache2 之后 第一个请求

    在 Linux 64 位 Ubuntu 12.10 上

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-09-04
      • 1970-01-01
      • 1970-01-01
      • 2017-07-13
      • 1970-01-01
      • 2020-07-20
      • 2019-03-10
      相关资源
      最近更新 更多