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
7
votes
1 answer

How to enable OPCache for PHP7.1 on MAC Sierra (MAMP)

I've installed OPCache GUI from GitHub and installed in my Mac. But when I run the page, it shows The Zend OPcache extension is installed but not turned on I've enabled the OPCache in my php.ini file with these opcache.enable=1 …
owen
  • 115
  • 5
  • 12
7
votes
1 answer

Zend Opcache not caching all files (CentOS 6.7 + Nginx 1.8.1 + PHP 7 + Laravel 5.1)

So, we have a Laravel 5.1 based project we want to release soon, but we're noticing poor performance, and we're trying to optimize the server setup. As listed in the title, we're deploying this on a CentOS 6.7 server, with Nginx 1.8.1 and PHP 7 with…
santista
  • 71
  • 1
7
votes
2 answers

Opcache clears too quickly

I have setup my website on a new hosting (virtual cloud), however I am looking at the opcache and the scripts not being used for say a minutes or so are removed from the cache. So is there a way to stop it? or is it a normal behaviour? Thanks a lot.
Raheel Hasan
  • 5,753
  • 4
  • 39
  • 70
7
votes
2 answers

How to use ZendOpCache for Doctrine2 cache?

I have installed PHP 5.5.1 in my development environment, and also have config Zend OpCache as Cache provider. Everything is working on the server with the new version and settings, but inside my symfony 2 project I have the Doctine2 cache to store…
unairoldan
  • 2,775
  • 4
  • 28
  • 49
6
votes
1 answer

How does OPcache max_accelerated_files actually work?

Maybe this is stupid question but i'm trying to figure out how does max_accelerated_files actually work... I understand the "description/instructions" from PHP net opcache.max_accelerated_files integer The maximum number of keys (and therefore…
Valor_
  • 3,461
  • 9
  • 60
  • 109
6
votes
1 answer

Revalidate opcache only after git push

I'm using PHP with OPcache. I only git-push to master to deploy my web site in production (not really, it's just after unit tests, but never mind). In php.ini file, OPcache settings are about "time" and "frequency". But I just want to reset cache…
rap-2-h
  • 30,204
  • 37
  • 167
  • 263
6
votes
4 answers

Opcache revalidate freq config in php.ini

If I'm setting this config in php.ini file: opcache.revalidate_freq = 0 Will it still be better than disable Opcache system? Because in my opinion, it will check for file updates every request, so it like the Opcache is disabled.
Upim form
  • 67
  • 1
  • 7
6
votes
3 answers

Opcache - Clean cache in PHP5.4 and lower

Is there a way to clean/reset the cached files using Opcache with PHP5.4 or lower? Here is the opcache_reset() function which just seems to work with PHP5.5 A workaround was to reboot... Edit: I opened an issue on Github
schickling
  • 4,000
  • 4
  • 29
  • 33
5
votes
1 answer

We're seeing "corrupted" opcache on our servers. Any idea how to resolve?

We're seeing an odd issue that I've been struggling to resolve. Every now and then we do a deploy to our servers, and one server will start streaming errors into the logs along the lines of, require_once(): Failed opening required…
Stephen Melrose
  • 4,772
  • 5
  • 29
  • 42
5
votes
1 answer

When does PHP's opcache re-parse a file?

Just what the subject says - when does PHP's opcache re-parse a file? Is it based on file timestamp, or file hash or what? Edit: If my question is not clear then I'll try again:) Say a file "xyz.php" is already in OPCache. Now I modify the file -…
konrados
  • 1,047
  • 8
  • 21
5
votes
2 answers

"Fatal error: Cannot declare class" after upgrading to PHP 7.0.8

I was using PHP 7.0.4 and everything was running smoothly and I just upgraded to PHP 7.0.8 and I started getting errors like this one all over the place. Fatal error: Cannot declare class Plugins\Users\Plugin because the name is already in use in…
php_nub_qq
  • 15,199
  • 21
  • 74
  • 144
5
votes
1 answer

Activate both, WinCache and OpCache for php 5.6 to improve performance?

We're running a typo3-website on Windows Server using IIS 8.5 and php 5.6.15 via FastCGI. To improve performance and reduce db-load, we enabled the WinCache-Extension, because of it's UserCache capabilities. WinCache's OpCache is disabled, since it…
mjStallinger
  • 192
  • 2
  • 15
5
votes
1 answer

Opcache causes PHP Fatal error: Class '\xa0L\xdaor\x7f' not found

Every now and then an image resizing script on our site will fail with the following error: PHP Fatal error: Class '\xa0L\xdaor\x7f' not found ... on line 4 The actual line 4 of the script in question is: $photo = new Photo($photo_id); I have no…
cshehadi
  • 111
  • 5
5
votes
2 answers

How to clear user cache in APCu?

I have tried to clear the user cache using this PHP code and access it from the browser: true, )); but it doesn't work. (I am…
Keloglan
  • 53
  • 1
  • 1
  • 7
5
votes
1 answer

OpCache - understanding how the cache works, per user or per resource?

I'm using OpCache since it came with PHP 5.5.x and I'm really pleased with it, but I would like to tune its memory settings and that's where my understanding comes short... When a given user requests a given page, the server answers this requests,…
Julio María Meca Hansen
  • 1,303
  • 1
  • 17
  • 37
1 2
3
20 21