本文介绍了Symfony2 bootstrap.php.cache尝试包含不存在的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Symfony 2.6.8应用程序,我们随机获得了这个奇怪的错误日志:

we have a Symfony 2.6.8 application, we randomly get this weird error log:

bootstrap.php.cache的第2752行是:

if ($file = $this->findFile($class)) {
    require $file; // line 2752
    return true;
}

findFile()方法是:

public function findFile($class)
{
    if (false === $file = apc_fetch($this->prefix.$class))
    {
        apc_store($this->prefix.$class, $file = $this->decorated->findFile($class));
    }
}

其他配置信息,我们正在使用:

Additional configuration informations, we are using:

  • Symfony 2.6.8
  • PHP 5.4.41
  • APC 3.1.13

我不明白要求的这个aab文件是什么.我们正在使用APC自动加载器,因此我怀疑APC的条目已损坏,因为重新启动Apache2时,该应用程序按例外方式工作.当应用程序处于这种状态时,我无法调试,因为我们使用apc.stat = 0,因此不会在每次请求时重新加载php文件.修改引导程序无效.

I don't understand what is this aab file that is requested. We are using an APC autoloader, so I am suspecting that APC has corrupted entries becausewhen restarting Apache2, the application works as excepted. I can't debug when the application is in this state because we use apc.stat = 0 so the php files are not reloaded at each request. Modifying the bootstrap doesn't work.

也许我们的APC设置不适用:

Perhaps our APC settings are not adapted:

apc.cache_by_default => On => On
apc.canonicalize => On => On
apc.coredump_unmap => Off => Off
apc.enable_cli => Off => Off
apc.enabled => On => On
apc.file_md5 => Off => Off
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.include_once_override => Off => Off
apc.lazy_classes => Off => Off
apc.lazy_functions => Off => Off
apc.max_file_size => 1M => 1M
apc.mmap_file_mask => no value => no value
apc.num_files_hint => 1000 => 1000
apc.preload_path => no value => no value
apc.report_autofilter => Off => Off
apc.rfc1867 => Off => Off
apc.rfc1867_freq => 0 => 0
apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS
apc.rfc1867_prefix => upload_ => upload_
apc.rfc1867_ttl => 3600 => 3600
apc.serializer => default => default
apc.shm_segments => 1 => 1
apc.shm_size => 128M => 128M
apc.shm_strings_buffer => 4M => 4M
apc.slam_defense => On => On
apc.stat => Off => Off
apc.stat_ctime => Off => Off
apc.ttl => 0 => 0
apc.use_request_time => On => On
apc.user_entries_hint => 4096 => 4096
apc.user_ttl => 0 => 0
apc.write_lock => On => On

任何提示都会受到欢迎!

Any hint would be welcome!

推荐答案

此问题中的解释与之完全相同:.

As explained in this question which is exactly the same issue: "Call to undefined method" after apache reload using apc opcode cache.

该错误来自于Apache2重新加载以进行日志轮换.

The bug comes from the Apache2 reload for the log rotate.

删除ApcAutoloder解决了该问题.

这篇关于Symfony2 bootstrap.php.cache尝试包含不存在的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!