Enabling PHP7 Opcache

Shiv picture Shiv · Aug 29, 2016 · Viewed 18.4k times · Source

I recently upgraded to PHP 7.

I placed this in /etc/php.d/opcache.ini

opcache.file_cache = /var/www/html/.opcache
opcache.file_cache_only = 1

and created the directory (as root)

When I visit the site there is nothing created in the .opcache folder

a phpinfo(); reflects the changes I made in opcache.ini

How can I get PHP 7 Opcache working at optimal performance with WordPress?

update The problem was witch folder permissions. 'Ale sure the Apache can write to it.

What are the optimal settings for it? Security and speed wise?

Answer

Shiv picture Shiv · Sep 11, 2016

I fixed this by making sure apache get write to the folders I created. Once that was done restarting httpd made it work.