PHP5.5+启用OPCache

 APC在PHP5.4及以下版本是性能最好的代码缓存。

不过PHP升级到5.5及以上后,APC不再有效。需要使用Zend的OpCache扩展。

要启用Opcache扩展,有两步:

1. 安装opcache

编译安装PHP5.5的时候加上–enable-opcache

2.在php.ini文件中添加如下配置:

 

zend_extension=opcache.so
[opcache]
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable=1
opcache.enable_cli=1

然后检查下phpinfo:

转自: http://blog.csdn.net/iefreer/article/details/38349057



文章来自: 本站原创
Tags:
评论: 0 | 查看次数: 13856