Peter Rehm's Blog

apple,development,life & more

PHP 5.5 Opcache in Development

Ohne Kommentare

PHP 5.5 comes with the Zend Opcache built in. There are also recommended
settings for production which needs to be adjusted for development.

In development you usually dont want to wait until you see your latest changes.
Therefore you need to set the revalidate_freq to 0 in order to revalidate the
files on each request. My development configuration looks like following:

CODE:
opcache.enable=On
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=0
opcache.fast_shutdown=1
opcache.enable_cli=1


To manually clear the opcache just execute the following in your command
line:

CODE:
php -r 'opcache_reset();'


NOTE: In case you are going to use Zend OPcache together with Xdebug,
be sure that Xdebug is loaded after OPcache. "php -v" must show Xdebug
after OPcache.

Geschrieben von Peter Rehm

14.07.2013 um 12:36:34

Tags für diesen Artikel: ,