安装
Zend Opcache 的源代码托管在 github 上,目前还是叫做 ZendOptimizerPlus。
编译安装步骤:
git clone https://github.com/zendtech/ZendOptimizerPlus.git
cd ZendOptimizerPlus/
/usr/local/server/php5.3/bin/phpize
./configure --enable-opcache --with-php-config=/usr/local/server/php5.3/bin/php-config
cp modules/* /usr/local/server/php5.3/ext/
配置 php.ini
vim etc/php.ini
[opcache]
zend_extension = /usr/local/server/php5.3/ext/opcache.so
opcache.enable=1
opcache.memory_consumption = 128
opcache.interned_strings_buffer = 8
opcache.max_accelerated_files = 4000
opcache.revalidate_freq = 60
opcache.fast_shutdown = 1
opcache.enable_cli = 1
完整配置信息
http://www.php.net/manual/zh/opcache.configuration.php