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
13
votes
2 answers

How to install PHP Opcache on MacOS High Sierra?

I'm using the standard Apache and PHP 7.1 (not Homebrew) that comes with Mac High Sierra. However, it appears that this version doesn't have Opcache enabled even though it should come as standard with PHP 7. It's even listed in phpinfo() under…
DisgruntledGoat
  • 70,219
  • 68
  • 205
  • 290
13
votes
1 answer

Blacklist a directory with Zend Opcache

How can i tell Zend Opcache not to cache any files from a specific directory. For e.g /var/www/public_html/devzone/* I use PHP 5.5.13 with Zend OPcache v7.0.4-dev
user2650277
  • 6,289
  • 17
  • 63
  • 132
11
votes
2 answers

Enable opcache for php in wamp

I try to enable opcache on wamp but it doesnt work. I changed the settings like this :…
I_G
  • 413
  • 1
  • 4
  • 18
11
votes
1 answer

PHP 5.6 function_exists strange behavior with OPCache

I stumbled upon strange behavior of php function function_exists() in PHP 5.6. The thing is, that if I provide the function name parameter directly as string, the result is different than when provided as variable. Here is the…
dave
  • 241
  • 1
  • 7
11
votes
3 answers

Full alternative to APC user data cache for PHP?

I have a large site heavily depending on APC, mainly storing custom data using apc_add and apc_fetch functions. It seems that APC is not fully compatible with PHP 5.4 and that PHP 5.5 has built in Zend OPcache. What alternative do I have to replace…
Frodik
  • 14,986
  • 23
  • 90
  • 141
10
votes
1 answer

How To Debug and Log PHP OPcache Issues

I am using WAMP on Windows 10, running PHP 7.2 with Apache 2.4 When I am turning on OPcache, a page I am loading crashes with the following error in Chrome: ERR_CONNECTION_RESET I checked the php error log and Apache error log and could not find…
Nikita 웃
  • 2,042
  • 20
  • 45
10
votes
1 answer

Can PHP7 opcached files be distributed without source code?

PHP7 offers a bytecode caching mechanism called opcache. I'd like to know if there is any way to distribute and run the "opcached" version of a PHP script (.bin file extension) without distributing its source code. (I enabled the opcache.file_cache…
dasup
  • 3,815
  • 1
  • 16
  • 25
10
votes
6 answers

Enabling Opcache Not Working

I am trying to enable Opcache, but for some reason, after editing my php.ini file and restarting apache (even rebooting the server), it still does not get enabled. Running a test I can see that that the php files location: Loaded Configuration File …
user2694306
  • 3,832
  • 10
  • 47
  • 95
9
votes
1 answer

Enable OPCache not working in WAMP

I tried to enable OPCache for Drupal 8.0.4 in WAMP 3 but it isn't working. So I googled and changed a few things in my php.ini file and here is what I changed: opcache.enable=0 to opcache.enable=1 and…
Hello Man
  • 693
  • 2
  • 12
  • 29
9
votes
2 answers

Do I need memcached with Opcache ?

I don't know anything about caching other than having read that people use APC/Opcache/Memcache/Memchached/Varnish ... to makes PHP go faster :) So, I tried APC last week since I was on PHP5.4, but then updated my to PHP5.5 so I could use Opcache.…
robue-a7119895
  • 816
  • 2
  • 11
  • 31
9
votes
2 answers

Why is PHP 5.5's OPcache showing zero hits? suPHP the culprit?

PHP 5.5's OPcache extension is enabled on my (shared) web host, but for some reason it always reports "0 hits" in the stats. Could that be because it's not compatible with suPHP? Or anyone have any other suggestions as to why there are 0 cache…
Simon East
  • 55,742
  • 17
  • 139
  • 133
9
votes
3 answers

Is each php-fpm pool having their own memory pool?

Let say I am using the PHP 5.5 opcode cache, and set opcache.memory_consumption=128 , if I have 4 pools in php-fpm, will each of the 4 pool share 128MB of cache, or will they own 128M opcache for each pool?
Ryan
  • 10,041
  • 27
  • 91
  • 156
8
votes
1 answer

How to enable optimizations in opcache (in an official php-fpm docker image)

The container is built from a trivial Dockerfile: FROM php:7.2.19-fpm RUN docker-php-ext-configure opcache --enable-opcache \ && docker-php-ext-install opcache I did not change php.ini, so all the settings are default. What's unexpected is…
zerkms
  • 249,484
  • 69
  • 436
  • 539
8
votes
1 answer

using both Opcache and Xcache

I'm just wondering is it stupid to use both Xcache 3 with Zend Opcache at the same time to cache PHP files? I know that both do almost the same job, but not sure if that would make any difference on the performance and speed. I want to speed up my…
Digital site
  • 4,431
  • 12
  • 48
  • 72
8
votes
2 answers

Can not install php 5.5 opcache on Centos 6.4

I have php 5.5 installed on CentOS (from Remi repo, as far as I remember). Now I wanted to turn on opcache and configure it, but it turned out that I have no opcache.so file in the system. So I tried to install it with yum. # yum --enablerepo=remi…
kovpack
  • 4,905
  • 8
  • 38
  • 55
1
2
3
20 21