Php 使APC转储缓存文件的二进制操作码失败?
main.php:Php 使APC转储缓存文件的二进制操作码失败?,php,apc,Php,Apc,main.php: require "/root/test.php"; print_r(apc_cache_info()); apc_bin_dump(array("/root/test.php")); test.php: $x = "a"; echo $x; 成功执行test.php并回显“a” apc_cache_info()显示两个文件都已缓存: [...] [cache_list] => Array ( [0] => Array
require "/root/test.php";
print_r(apc_cache_info());
apc_bin_dump(array("/root/test.php"));
test.php:
$x = "a";
echo $x;
成功执行test.php并回显“a”
apc_cache_info()显示两个文件都已缓存:
[...]
[cache_list] => Array
(
[0] => Array
(
[type] => file
[device] => 2049
[inode] => 26472
[filename] => /root/test.php
[num_hits] => 0
[mtime] => 1322736219
[creation_time] => 1322737193
[deletion_time] => 0
[access_time] => 1322737193
[ref_count] => 0
[mem_size] => 4168
)
[1] => Array
(
[type] => file
[device] => 2049
[inode] => 26476
[filename] => /root/main.php
[num_hits] => 0
[mtime] => 1322736869
[creation_time] => 1322737193
[deletion_time] => 0
[access_time] => 1322737193
[ref_count] => 0
[mem_size] => 4168
)
)
[...]
但apc_bin_dump的生产线会产生一个“神秘”的警告:
怎么了
CLI的APC设置:
apc
APC Support => enabled
Version => 3.1.7
APC Debugging => Disabled
MMAP Support => Enabled
MMAP File Mask =>
Locking type => pthread mutex Locks
Serialization Support => php
Revision => $Revision: 307215 $
Build Date => Feb 27 2011 19:39:21
Directive => Local Value => Master Value
apc.cache_by_default => On => On
apc.canonicalize => On => On
apc.coredump_unmap => Off => Off
apc.enable_cli => On => On
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 => 32M => 32M
apc.slam_defense => On => On
apc.stat => On => On
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
它写在信息本身中 必须使用apc.stat=0的完整路径包含缓存文件 你的背景是
apc.stat => On => On
禁用
apc.stat
或不使用apc\u bin\u dump()
。该消息告诉您,无论出于何种原因,都不可能同时执行这两项操作。这意味着什么?我尝试了绝对路径和相对路径的组合。那也不行。或者你认为我应该关闭apc.stat。。。如果是,你知道为什么吗?@affael1984:请把我的答案读到最后:它是关于apc.stat
|不,我不知道为什么,但我现在没有搜索原因。我们的编辑有一个种族条件;)然而,根据你的问题,这个答案是完整的。如前所述,我不知道为什么不能同时使用stat=1
和函数。答案是:如果你想使用该函数,请设置stat=0,或者不使用该函数。我的推理哲学方法具有更全面的性质,错误消息会误导我。我将其解释为“当您将apc.stat设置为零时,您必须使用完整路径。”将其设置为零对我也起到了作用。
apc.stat => On => On