4

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?

Philipp
  • 2,787
  • 2
  • 25
  • 27
Shiv
  • 831
  • 1
  • 12
  • 29
  • I would start by checking the owners/groups/permissions on that folder to make sure your web server can write to it. – cmorrissey Aug 29 '16 at 17:32
  • @cmorrissey thanks! What are the recommended settings for it speed and security wise? I read about a webshell exploit, has this been patched or do I need to do something to avoid it? – Shiv Aug 29 '16 at 17:48
  • Why file cache? This sucks. RAM would be much better. – Mike Doe Dec 31 '16 at 23:21
  • If you want to use "file caching", but where the files actually exist in RAM, set the file_cache to `/dev/shm` – Terry Nov 20 '17 at 19:10

1 Answers1

4

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

Shiv
  • 831
  • 1
  • 12
  • 29