How can I activate the php opcache?

In the file /usr/local/etc/php.ini, the configuration lines for the opcache must be changed or added as follows:

[opcache]
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

Then start the php_fpm service:

sudo service php_fpm restart