Questions tagged [opcache]

OPcache is a PHP opcode cache introduced in PHP 5.5 (and is also available as a PECL extension for PHP 5.2+). It is based on the Zend Optimizer+

The Zend OPcache provides faster PHP execution through opcode caching and optimization. It improves PHP performance by storing precompiled script bytecode in the shared memory. This eliminates the stages of reading code from the disk and compiling it on future access. In addition, it applies a few bytecode optimization patterns that make code execution faster.

Also see the OpCache Readme, the PHP OPcache documentation and the PECL OPcache page.

304 questions
5
votes
3 answers

PHP 5.5 OPCache not working on apache

I'm in charge of the opcode cache exchange here in my company, we're moving from eaccelerator to the Zend OPCache shipped with PHP 5.5. When I access PHP in CLI, it seems like the OPCache is working fine: PHP 5.5.5 (cli) (built: Oct 15 2013…
Denis Lins
  • 816
  • 7
  • 22
4
votes
1 answer

enabling opcache on mac catalina, php 7.4 installed with homebrew

I've modified the php.ini file to enable opcode caching and restarted apache but it is nowhere in sight with phpinfo(). php -v says: PHP 7.4.1 (cli) (built: Dec 18 2019 14:46:18) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c)…
StevieD
  • 6,925
  • 2
  • 25
  • 45
4
votes
1 answer

php7.4 opcache.preload - Errors on fpm start

I'm upgrading to php7.4 and want to take advantage of the new opcache preloading. When I service php7.4-fpm start I get the following errors: NOTICE: PHP message: PHP Warning: PHP Startup: failed to open stream: Permission denied in Unknown on line…
Redzarf
  • 2,578
  • 4
  • 30
  • 40
4
votes
1 answer

OPCache is enabled, but php -i shows it is disabled

I installed NextCloud and in the summary window it keeps telling me that my OPCache is not enabled. I have enabled it and I am seeing conflicting information about if it really is enabled or not. Ubuntu 18.04.1 | PHP 7.2.11-2 $ sudo cat…
user2613018
  • 91
  • 1
  • 2
  • 7
4
votes
1 answer

Why won't composer use OPcache?

I added "require": { "ext-opcache": "*", to composer.json for an eDirectory Symfony 2.8 app, but it gave me an error: $ composer update Loading composer repositories with package information Updating dependencies (including require-dev) Your…
Chloe
  • 25,162
  • 40
  • 190
  • 357
4
votes
0 answers

What are the negative consequences of PHP opcache.dups_fix?

Does anyone know much about the opcache option opcache.dups_fix? The documentation states "This hack should only be enabled to work around "Cannot redeclare class" errors." We are seeing said errors that can really only be attributed to an opcache…
habiem
  • 51
  • 5
4
votes
1 answer

opcache has zero hits with cgi/fastcgi

I'm trying to get opcache working on my server that is hosting a website in apache2. I'm running debian 8. However it seems to be hitting zero of the scripts. I've already tried to change the php mode to cgi only but this didn't change anything.…
NoSixties
  • 2,443
  • 2
  • 28
  • 65
4
votes
1 answer

Enabling PHP7 Opcache

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…
Shiv
  • 831
  • 1
  • 12
  • 29
4
votes
3 answers

php not showing changes to files consistently

I am making changes to php files and they are not showing -- sometimes. Sometimes they will show immediately. Sometimes I have to wait a few minutes. I've gone through and turned off all the cache that I could think to turn off. The problem is…
Richard
  • 5,584
  • 1
  • 19
  • 22
4
votes
1 answer

OpCache with Symfony

I know you can use with Symfony APC or XCache Class Loader. Unfortunately, in the shared server where I put my Symfony code, there is only OpCache with is activated. Can I use Symfony with OpCache ? If yes, how and what is the code to put in my…
user849017
  • 193
  • 1
  • 3
  • 10
4
votes
1 answer

Can PHP 5.5.5 load Phar files from OPcache?

The version of PHP in use is 5.5.5 and I know this version of PHP can store precompiled script bytecode in shared memory, as mentioned in the following page: http://php.net/manual/en/intro.opcache.php I also know OPcache can compile files as…
Professor of programming
  • 2,978
  • 3
  • 30
  • 48
4
votes
2 answers

Enable PHP 5.5 OPCache

After configuring OPCache as recomanded, It's not working. So, How to debug OPCache to see where is the problem? Or I am missing something? My config: php.ini php -v And in code opcache_get_status(); // return false //but extension_loaded('Zend…
tasmaniski
  • 4,767
  • 3
  • 33
  • 65
4
votes
2 answers

How to install Zend OPcache Extension + PHP >= 5.4 on Windows

Is it possible to install Zend OPcache module for PHP 5.4.29 in Windows Environment? I have downloaded OPCache that was meant to be compatible with PHP 5.4 but php -v does not show anything new loaded.
Flasz
  • 185
  • 1
  • 2
  • 12
3
votes
1 answer

JIT for PHP 8.1.21 will cause 503 server error

I try to follow the instructions here to enable JIT in PHP 8.1.21 I set the JIT buffer size to 256M, as below: opcache.jit_buffer_size=256M I also enabled opcache.enable_cli as this article suggests me to do…
alancc
  • 487
  • 2
  • 24
  • 68
3
votes
0 answers

Choosing the best `opcache.jit_buffer_size` value in PHP8 & JIT

I've been looking for some guidelines regarding the optimal value of opcache.jit_buffer_size. The proposed values are up to 256M (e.g. https://php.watch/versions/8.0/JIT#jit-opcache.jit_buffer_size) or even 500M…
jacek.ciach
  • 904
  • 11
  • 20