Heads up! This post was written 11 years ago. Some information might be outdated or may have changed since then.
For using builtin opcache in php we must edit
php.ini file and remove some comments like this: [opcache]
opcache.enable=1
opcache.enable_cli=0
opcache.memory_consumption=64
opcache.max_accelerated_files=2000
opcache.validate_timestamps=1
opcache.revalidate_freq=0
opcache.save_comments=0
opcache.load_comments=0
opcache.fast_shutdown=1 and after that just restart php5-fpm process for nginx servers or if you are using apache2 restart apache server: service php5-fpm restart That is :) You can check if it's enabled by typing
php -v and result must be like: root@eureka:~# php -v
PHP 5.5.9-1ubuntu4.4 (cli) (built: Sep 4 2014 06:56:34)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies If you want to watch simple stats about opcache you can check this script https://github.com/rlerdorf/opcache-status/blob/master/opcache.php For more information about opcache visit https://wiki.php.net/rfc/optimizerplus