Need help with opcache

Mr-Pro

Verified User
Joined
Dec 19, 2017
Messages
30
Hello guys ,
I used custombuild to install opcache on my server . Should I do something else in order to activate it on my websites ? I mean should I edit any config files to include opcache? How can I confirm it's working?
Regards ,
 
Hi,

As I know, you don't need to edit the config file unless you dont want the default setting. To check if it works, see phpinfo();
 
Hello,

The docs say:

OPcache improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request.

opcache.enable boolean
Enables the opcode cache. When disabled, code is not optimised or cached. The setting opcache.enable can not be enabled at runtime through ini_set(), it can only be disabled. Trying to enable it at in a script will generate a warning.


So your application can not enable OPcache, it should be enabled from the moment of installation and restart of apache/php-fpm depending on what mode of PHP you use.

Nevertheless it's possible that your PHP application disables opcache through ini_set(), but I've never heard or seen of WordPress doing this. Anyway feel free to check your settings in admin area of your PHP application.

As for caching at application level you can use redis for example, and in order to use it you should configure your PHP application accordingly.
 
There is nothing special - just enable it in Custombuild and leave DA to do it's work in activating it. You can fine tune it if you wish from the config file but usually that's not needed as the default settings are OK.

Imortant - do NOT use opcache with PHP 5.6.30 or lower in the 5.x branch and PHP 7.0.13 or lower in the 7.x branch - it's a security risk. Newest 5.6.x and 7.0.x/7.1.x/7.2.x are OK.
 
opcache is help so much with speed but...
opcache need more ram, please consider this one.
 
opcache is help so much with speed but...
opcache need more ram, please consider this one.
By default opcache only uses 128MB on each PHP version you are using. To change you can follow these instructions:
 
By default opcache only uses 128MB on each PHP version you are using.

Do this test:

1. Disable opcache and watch your "top" to see how much MB of RAM each php-fpm process takes
2. Enable it and do the same

You will be surprised :)
 
Back
Top