我安装了APC 3.1.5testing版,因为3.0.19给了我一些奇怪的错误。
3.1.5安装正常,它出现在phpinfo和function工作没有错误。 唯一的问题是数据不能持久保存。
我可以在同一个脚本中执行apc_store和apc_fetch,并且在同一个实例中它将返回存储的数据,但是如果我使用两个实例,一个存储和另一个提取,那么以后不会返回任何东西,就像密钥一样不存在。
也使用apc.php提供我得到以下信息,可能有所帮助:
Shared Memory 1 Segment(s) with 32.0 MBytes (mmap memory, pthread mutex locking) Uptime 0 minutes Runtime Settings apc.cache_by_default 1 apc.canonicalize 1 apc.coredump_unmap 0 apc.enable_cli 0 apc.enabled 1 apc.file_md5 0 apc.file_update_protection 2 apc.filters apc.gc_ttl 3600 apc.include_once_override 0 apc.lazy_classes 0 apc.lazy_functions 0 apc.max_file_size 1M apc.mmap_file_mask /tmp/apc.rSmNYe apc.num_files_hint 1024 apc.preload_path apc.report_autofilter 0 apc.rfc1867 0 apc.rfc1867_freq 0 apc.rfc1867_name APC_UPLOAD_PROGRESS apc.rfc1867_prefix upload_ apc.rfc1867_ttl 3600 apc.shm_segments 1 apc.shm_size 32M apc.slam_defense 1 apc.stat 1 apc.stat_ctime 0 apc.ttl 0 apc.use_request_time 1 apc.user_entries_hint 4096 apc.user_ttl 0 apc.write_lock 1
在Apache 2.0.63,PHP 5.3.3,nginx 0.8.46,CentOS 5 64bit上使用pecl安装
有任何想法吗? 谢谢
使用APC,您必须使用mod_php或PHP-FPM,否则会为每个进程创build一个新的APCcaching,并且您的请求可能无法从同一进程提供。
您可以通过加载apc.php (APC包中的APC统计信息)来查看此效果,并查看caching位置在每个请求中的变化情况。
对于APC,我倾向于在Apache框上使用mod_php ,在nginx框上使用PHP-FPM 。 如果有人知道任何其他方法,请让我知道。 没有计划APC修复,因为它在PHP-FPM下工作正常。