【发布时间】:2012-04-12 10:23:15
【问题描述】:
我目前正在通过 mod_fastcgi 执行 PHP(当然是在 Apache 下),当我在 php.ini 配置文件中启用 APC 时,symfony 会随机抛出 500 错误。
当我在 Apache 重新启动后第一次调用 app.php 或 app_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