为什么我在使用 apc(在 Yii 框架中)时会随机遇到这个致命错误?
我有时会遇到
Fatal error: require() [<a href='function.require'>function.require</a>]: apc_fcntl_lock failed errno:6 in C:\web\yii\framework\web\CWebApplication.php on line 345
代码上下文:
else
$controllerID.='/';
$className=ucfirst($id).'Controller';
$classFile=$basePath.DIRECTORY_SEPARATOR.$className.'.php';
if(is_file($classFile))
{
if(!class_exists($className,false))
require($classFile); ////////////THIS IS LINE 345
if(class_exists($className,false) && is_subclass_of($className,'CController'))
{
$id[0]=strtolower($id[0]);
return array(
new $className($controllerID.$id,$owner===$this?null:$owner),
$this->parseActionParams($route),
);
}
return null;
}
相对运行时环境:
OS:win2k3.
PHP Version 5.3.6
Server API CGI/FastCGI
apc:
Version 3.1.8-dev
APC Debugging Disabled
MMAP Support Disabled
Locking type File Locks
Serialization Support php
Revision $Revision: 308812 $
Build Date Mar 1 2011 13:31:44
导致此错误的原因是什么?我该如何修复它?
I sometimes run into
Fatal error: require() [<a href='function.require'>function.require</a>]: apc_fcntl_lock failed errno:6 in C:\web\yii\framework\web\CWebApplication.php on line 345
code context:
else
$controllerID.='/';
$className=ucfirst($id).'Controller';
$classFile=$basePath.DIRECTORY_SEPARATOR.$className.'.php';
if(is_file($classFile))
{
if(!class_exists($className,false))
require($classFile); ////////////THIS IS LINE 345
if(class_exists($className,false) && is_subclass_of($className,'CController'))
{
$id[0]=strtolower($id[0]);
return array(
new $className($controllerID.$id,$owner===$this?null:$owner),
$this->parseActionParams($route),
);
}
return null;
}
Relative runtime environment:
OS:win2k3.
PHP Version 5.3.6
Server API CGI/FastCGI
apc:
Version 3.1.8-dev
APC Debugging Disabled
MMAP Support Disabled
Locking type File Locks
Serialization Support php
Revision $Revision: 308812 $
Build Date Mar 1 2011 13:31:44
What caused this error? How do I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这看起来像是 APC 问题,我也时常遇到。我无法 100% 告诉您发生了什么,但是,在开发过程中您经常更改、移动或覆盖文件。然后,APC 似乎丢失了内部用于处理字节码缓存的文件的索引节点。
对我来说,“修复”错误的唯一方法是重新启动网络服务器。
这是否也会发生在不经常更改源代码的生产系统上?
This looks like an APC issue, which I also encounter from time to time. I can't tell you 100% what's going on, but, while developing you often change, move or overwrite files. APC then seems to loose the inode of the file which is used internally to handle to bytecode-caching.
For me the only way to 'fix' the error is to restart the webserver.
Does this also happen on production systems, where you don't change the sourcecode very often?
似乎是 apc 的死锁错误 http://www.searchtb.com/ 2014/02/apc-lock-php-fpm.html 我向一位 apc 维护者询问了这一点,他建议我使用 opcache 而不是 apc。
Seems it's apc's deadlock bug http://www.searchtb.com/2014/02/apc-lock-php-fpm.html I asked one of the apc maintainers about this, he suggested me to use opcache instead of apc.