PHP Opcache Warning After Upgrade...Redis is installed

I just upgraded (finally) my Nextcloud server from 11.0.5 to 12.0.3. The server is running PHP7 and Redis for caching. After the upgrade, I am getting a warning in the Admin section: “The PHP OPcache is not properly configured. For better performance we recommend to use following settings in the php.ini:” Forgive my ignorance, but since I’m using Redis for caching, I don’t need Opcache, right? Or can I use both? I’m not that familiar with either one other than to get Redis working on a Nextcloud installation.

File caching (APCu, Redis etc.) and OPCache are two different things. OPCache caches only PHP scripts compiled and optimized, while Redis or APCu can cache other stuff, depending on how it is used by the software (Nextcloud).

So you should use both. To get rid of the OPCache warnings, add the following to your /etc/php/7.0/mods-available/opcache.ini or similar, depending on your system. php.ini would also work of course.

opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1