參考:http://www.php.net/manual/zh/opcache.installation.phpphp
1
2
3
4
5
6
7
|
wget http:
//pecl
.php.net
/get/zendopcache-7
.0.2.tgz
tar
zxvf zendopcache-7.0.2.tgz
cd
zendopcache-7.0.2
/usr/local/php/bin/phpize
.
/configure
--with-php-config=
/usr/local/php/bin/php-config
make
&&
make
install
ls
/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/
|
能夠看到 opcache.so 庫文件java
在PHP.ini添加以下代碼linux
1
2
3
4
5
6
7
8
9
|
[Zend Opcache]
zend_extension = /usr/local/php/lib/php/extensions/no-debug-non-zts-
20090626
/opcache.so
opcache.memory_consumption=
64
opcache.interned_strings_buffer=
8
opcache.max_accelerated_files=
4000
opcache.force_restart_timeout=
180
opcache.revalidate_freq=
60
opcache.fast_shutdown=
1
opcache.enable_cli=
1
|
對於上面opcache的各項選項介紹,請參考:http://www.php.net/manual/zh/opcache.configuration.phpshell
重啓php,經過 phpinfo(); 命令查看spa