I'd like to enable opcache preloading (RFC) on my production servers in PHP 7.4.
I'm using Symfony 4 if it changes anything.
OPCache can only be compiled as a shared extension under this version. Firstly, you need to enable the building of default extension with –enable-opcache option to make it available. Afterwards, you can use the zend_extension configuration directive to lead the OP Cache extension into PHP.
First of all you should add:
opcache.preload=/path/to/project/preload.php
to your php.ini
Then in your PHP script you should pass in opcache_compile_file($file);
each file you want to preloaded.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With