Enable Zend OPcache in PHP
To enable Zend OPCache in PHP, edit php.ini add following to end of the file
1 |
zend_extension=opcache.so |
Now you may need to adjust some settings, in php.ini uncomment following, change values as needed.
1 2 3 4 5 6 |
opcache.enable=1 opcache.enable_cli=1 opcache.memory_consumption=128 opcache.max_accelerated_files=10000 opcache.validate_timestamps=1 opcache.revalidate_freq=10 |
Verify it with
1 2 3 4 5 |
[root@vps154294 php]# php -m | grep Zend Zend OPcache [Zend Modules] Zend OPcache [root@vps154294 php]# |
Restart web server. If you using php-fpm or fcgi, you need to restart the process.
phpinfo() will show