php之apc浅探

扩展编译:

./configure --enable-apc --with-php-config=/usr/local/php/bin/php-config --prefix=/usr/local/apc --enable-apc-debug

apc配置说明:

apc.enabled boolean

早期的php版本在编译php的时候可以配置是否支持apc,如果是编译php的时候编译进去的,只能通过禁用改选项来关闭apc。

apc.shm_segments integer

允许的最大内存块数

apc.shm_size integer

共享内存块大小(MB为单位)

apc.filters string

过滤不需要缓存的文件或文件夹 如 " /var/www/apc.php" 配置如此,则apc.php 将不被缓存

apc.filters="skt/.,erp/." 则只要请求skt或者erp文件下的文件都将不会缓存

apc.enable_cli

开启该配置,则shell下执行php文件中可以调用apc相关的函数。

apc.write_lock

繁忙服务器重启时,有可能多个进程试图修改同一个缓存文件,开启该配置,保证只有一个进程能够编译同一个文件。

apc内部结构:

原文地址:https://www.cnblogs.com/heat-man/p/8711756.html