Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php APC文件缓存不工作,但用户缓存正常_Php_Linux_Apache_Caching_Apc - Fatal编程技术网

Php APC文件缓存不工作,但用户缓存正常

Php APC文件缓存不工作,但用户缓存正常,php,linux,apache,caching,apc,Php,Linux,Apache,Caching,Apc,摘要:我将PHP(5.3.8)作为Apache模块安装,并通过PECL安装了APC。用户缓存工作正常,但文件缓存不工作(我确实将apc.cache\u默认设置为1,所以这不是问题所在) 详细信息: 我刚刚得到一个VPS(使用cPanel/WHM)来测试使用apc文件缓存和用户缓存可以在应用程序中获得什么好处 因此,我将PHP5.3编译为DSO(apache模块) 然后通过SSH通过PECL安装APC。(首先我尝试使用WHM模块安装程序,它也有同样的问题,所以我通过ssh进行了尝试) 一切似乎都很

摘要:我将PHP(5.3.8)作为Apache模块安装,并通过PECL安装了APC。用户缓存工作正常,但文件缓存不工作(我确实将apc.cache\u默认设置为1,所以这不是问题所在)

详细信息: 我刚刚得到一个VPS(使用cPanel/WHM)来测试使用apc文件缓存和用户缓存可以在应用程序中获得什么好处

因此,我将PHP5.3编译为DSO(apache模块)

然后通过SSH通过PECL安装APC。(首先我尝试使用WHM模块安装程序,它也有同样的问题,所以我通过ssh进行了尝试)

一切似乎都很好,phpinfo显示apc已加载并启用

然后我检查了apc.php。一切似乎都很好

但是,当我开始测试我的php应用程序时,apc中文件缓存信息的状态:

Cached Files    0 ( 0.0 Bytes)  
Hits    1  
Misses  0  
Request Rate (hits, misses) 0.00 cache requests/second  
Hit Rate    0.00 cache requests/second  
Miss Rate   0.00 cache requests/second  
Insert Rate 0.00 cache requests/second  
Cache full count    0  
这意味着没有PHP文件被缓存,尽管我浏览了10多个包含多个包含的PHP文件。所以一定有一些缓存文件

但是用户缓存运行正常

User Cache Information  
Cached Variables    0 ( 0.0 Bytes)  
Hits    1000  
Misses  1000  
Request Rate (hits, misses) 0.84 cache requests/second  
Hit Rate    0.42 cache requests/second  
Miss Rate   0.42 cache requests/second   
Insert Rate 0.84 cache requests/second  
Cache full count    0
上面的用户缓存输出来自APC缓存测试脚本,该脚本尝试检索和存储1000个条目,并给出时间。一种简单的基准测试

有人能帮我吗。
即使apc.cache\u默认值为1,也不会缓存任何php文件

这是我的apc配置

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    
apc.num_files_hint  1000  
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.serializer  default  
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
此外,大多数php文件小于20KB,因此,apc.max_file_size=1M不是原因

我试过做一些事情,但运气不好

  • 使用“apc_compile_file”强制某些文件进入操作码缓存,但没有运气
  • 在启用调试的情况下重新安装APC,但错误日志中未显示任何内容
  • 将mmap_file_mask设置为/dev/zero和/tmp/apc.xxxxxx,我还将/tmp权限设置为777,但没有效果
  • 设置apc.enable_cli=1并从cli运行脚本
  • 将apc.max\u文件大小设置为5M(以防万一)
  • 在WHM中将php处理程序从dso切换到FastCGI(然后将其切换回dso,因为它没有解决问题)
  • 甚至尝试重新启动容器
  • 任何线索,任何人


    注意:我已经在serverfault.com上发布了这个问题,但没有得到太多的意见或答案,所以我在这里发布(因为stackoverflow似乎更活跃,我只有1个月的时间来测试我的VPS,看看它是否有任何过度共享的用途)

    看来问题出在SourceGuardian身上。
    在注释掉php.ini中的extension=“ixed.5.3.lin”之后,文件缓存现在工作正常

    这是由我的主机提供商的支持人员发现的,所以我对如此强大的支持表示赞许。我好几天都不会发现这个问题

    思想应该把答案贴出来,以防别人在这个问题上绊倒