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+
307
questions
-2
votes
0
answers
40
views
OPcache uses most of memory
A few sites are hosted on a server that has 2GB RAM. OPcache must be offered to all sites.
At its peak, OPcache can take up to 1.5GB, then a few other processes using 300MB.
We are left with 200MB.
...
1
vote
0
answers
43
views
Will PHP code work slower after obfuscation process with OPcache?
According to this scheme after launch of the code it transforms to opcode (bytecode), stores in OPcache and then execute in Zend VM (Virtual machine). And next launches will not transform code, but ...
0
votes
0
answers
65
views
PHP FPM docker image, opcache File Cache keep disabled
I'm trying to turn to Enabled "Zend OPcache - File Cache" in a docker PHP-FPM image. Currently, it's Disabled and the time to render a basic page on a Symfony website takes about 15 sec ...
-1
votes
1
answer
82
views
Why is this certain PHP installation so slow?
I have a VPS under Ubuntu 20, running php (php-fpm), installed the ordinary way from ppa:ondrej/php repo.
And it has Opcache enabled by default, and I would expect for server like this to complete a ...
0
votes
0
answers
55
views
PHP + OpCache Clear - should you clear this?
We have a webserver running PHP with OpCache and different pools but they end up getting full. Is it the responsibility of us developers to clear the OpCache or can we just let it run full and ...
0
votes
0
answers
18
views
I use direct admin and appy opcache for php 7.2 but I cannot add black list file name in opcache.ini
Config in opcache.ini
opcache.blacklist_filename=/opt/opcache_ignore.txt
Content in opcache_ignore.txt
/home/cloudpro/domains/demo.cloupro.vn/public_html/config_override.cus.php
I hope to add ...
3
votes
1
answer
517
views
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 ...
0
votes
0
answers
83
views
OpCache: Shared memory and settings?
I have questions when using OPCache.
Whether the different websites share the same cache/keysets of OPCache? I just make a test. I have PHP 7.4 and 8.1 installed on my server. It seems websites using ...
1
vote
1
answer
105
views
Apache deployment with symlink on managed servers doesn't work
Here is the context of my problem : we have managed servers (Hetzner) and are trying to implement a zero downtime deployment with symlinks. Here is what we do on each push : we deploy the new code in ...
0
votes
0
answers
70
views
Opcache "old scripts" not removed with opcache_reset()... a problem with some deployment tools. How to solve?
I'm using a PHP deployment tool which creates multiple "release" directories, with a current symlink pointing to the active (latest) release:
releases/
/1
/2
current -> releases/2
...
0
votes
1
answer
119
views
Why isn't my apache2 server recognizing my changes to my opcache PHP settings?
Hello, thanks for dropping by. I would like to know why my opcache settings are being ignored.
I'm running Apache2 2.4 on a recent flavor of debian linux on a remote server
I wish to increase my ...
4
votes
0
answers
1k
views
Choosing the best `opcache.jit_buffer_size` value in PHP8 & JIT [closed]
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) ...
1
vote
1
answer
617
views
PHP-FPM slows down after a while - Opcache File Cache
My set up is a large drupal website with 50,000 requests per day. My main issue is that Php-fpm slows down after 10-15 minutes of a restart (1500+ code files). Cache is only full 40% (174mb of 512mb). ...
0
votes
0
answers
28
views
- amnuts/opcache-gui 2.5.4 requires ext-zend-opcache * -> it is missing from your system
I'm trying to run 'composer install' command on root directory of existing project, but when I run this command it's giving 'ext-zend-opcache' missing error.enter image description here
I've enabled ...
0
votes
0
answers
102
views
Zend OPcache file cache
first of all I'm new here so I apologize if I'm posting something wrong.
I'm using php 8.0.26 on a Wordpress based website and Zend OPcache is installed and running on my server, but I noticed that ...
0
votes
0
answers
84
views
How to make phpunit faster on big bootstrap
I've tried opcache but it even makes it lower, in some cli programs there is a watch option, the cli keeps running that on changes it will redo something, I couldn't find that for phpunit.
Just to be ...
1
vote
1
answer
123
views
MAMP Pro on Macos can't turn on opcache
I've had a problem since version 6
When we set this to opcache, it won't be saved on the next restart we see it says unsaved changes want to start? if you say yes it will still load opcache but as ...
-1
votes
1
answer
76
views
PHP script is not reacting to code changes, although opcache and jit are both disabled. What might be happening?
I have a php script that is not reacting to code changes that I make (I inserted a deliberate syntax error which is not be being picked up).
I am running php 8.1 on apache2 (on a local copy of ubuntu ...
1
vote
0
answers
272
views
PHP file cached and changes inside not visible (opcache?, Symfony)
Problem:
Hello, sometimes, when I update code in my Symfony app, the changes aren't visible in the browser.
clearing cache (php bin/console cache:clear) won't help.
removing var/cache/ won't help too....
1
vote
1
answer
207
views
Problem updating files in htdocs folder of XAMPP server
the htdocs folder (xampp) doesn't update the changes I make in the PHP file of the visual studio code, that is, I always need to make a copy and add it, can someone help me configure it to update ...
1
vote
0
answers
220
views
How to make sure that OpCache is caching files of my website ? (Prestashop)
I am trying to use Opcache on my Prestashop Website, I installed it and it seems active (see here) , but I want to be sure that it's actually caching the PhP scripts.
I have been looking into the ...
1
vote
0
answers
318
views
php caching - Cannot seem to disable opcache in MAMP Pro
This has come up a number of times in other threads, and I've tried every solution that I found with no luck.
Running MAMP Pro v6.6.3, and the opcache module is running wild. All my php pages are bing ...
2
votes
1
answer
401
views
Is blacklist of opcache ignored when file_cache is enabled?
I am using php-fpm 7.4.3 on ubuntu 20.04. My blacklist of opcache doesn't work at all. Scripts I visited are cached when file_cache is enabled. Here's my configures.
php.ini
opcache.save_comments=0
...
1
vote
1
answer
130
views
Automatically configure PHP_INI_SYSTEM directives
I need my project to use the following configuration directives:
opcache.enable=1
opcache.jit_buffer_size=50M
opcache.jit=tracing
These are PHP_INI_SYSTEM directives
Each time a user installs my ...
0
votes
1
answer
215
views
How to configure php 7.4 opcache to register cache hits?
PHP containers are running with the command php-fpm.
When I exec into one of them and run.
$ php -a
php > print_r(opcache_get_status());
I get the following results
(
[opcache_enabled] => 1
...
0
votes
0
answers
165
views
Persistent OPcache in CLI mode
I have a PHP script that executes background script in CLI mode via:
exec('php file.php > /dev/null &');
OPcache is enabled in both modes, however I have noticed that in cli mode opcache resets ...
0
votes
1
answer
240
views
How do I keep the most recent OPcache folder only?
I'm new to using OPcache on php 8 and I have some questions. So my folder structure looks like this:
https://i.stack.imgur.com/vb93u.png
Within each folder is the exact same thing, it's the structure ...
2
votes
0
answers
1k
views
PHP 8.1.4 - Opcache runs out of memory
I've been having trouble where TTFB would increase after a few hours. I initially thought it was due to something in IIS, but it turns out it's actually opcache.
I also noticed the "manual ...
1
vote
1
answer
204
views
PHP including the wrong file (twice)
I have two sites on the same Apache installation
Server version: Apache/2.4.41 (Ubuntu)
Server built: 2022-03-16T16:52:53
which are very similar. I have boiled down the problem to these three files:...
1
vote
1
answer
188
views
OPchache max keys cannot be changed
I want to increase the maximum number of cached keys in OPcache. As far as I understand this can be achieved by setting opcache.max_accelerated_files in the PHP settings.
However, the maximum number ...
2
votes
1
answer
1k
views
Opcache Preloading with Symfony 5.4 / PHP8 / Platform.sh
I am attempting to set up Opcache Preloading on Symfony 5.4 running on PHP8 at Platform.sh, and running into a fatal error.
Configuration
Necessary pieces included:
// platform.app.yaml
...
variables
...
2
votes
0
answers
1k
views
Error Building PHP 8 Dockerfile With OPCache Enabled
Randomly when I run my docker build i get a mail error halting CI. If I rerun the CI script in Gitlab once or twice woth no changes made to config it often successfully builds. I am at a loss as to ...
0
votes
1
answer
251
views
PHP 7.4 OpCache and FatFreeFramework
I am running a website on a PHP 7.4.12 system with the OpCache enabled. My question: Do I need to tell F3 in the settings to make use 7.4s cache options? If so, how would I do this.
1
vote
1
answer
4k
views
opcache.memory_consumption configuration
What will happen if I set higher value for a function in php.ini, For example set 2GB to opcache.memory_consumption for a normal e-commerce web application.
opcache.memory_consumption = 2048
Below is ...
0
votes
1
answer
201
views
Is opcache_reset supposed to work on windows?
Enviroment wamp on windows, PHP version 7.4
The result of opcache_get_status after calling opcode_reset shows
opcache_enabled => false
restart_pending => 1
This goes on for a long time and no ...
2
votes
1
answer
2k
views
Opcache preloading and missing App_KernelProdContainer.preload.php
After following the documentation, my new OPCache settings are like this:
opcache.preload_user=www-data
opcache.preload=/var/www/vhosts/.../httpdocs/.../var/cache/prod/App_KernelProdContainer.preload....
1
vote
0
answers
500
views
Flush PHP OpCache in a multi-replica Docker Swarm or Kubernetes cluster
I have a Docker Swarm cluster (and a Kubernetes cluster too, in another infrastructure) with a scalable PHP-FPM Docker service, with the Zend OpCache extension installed, and mostly used to serve PHP-...
0
votes
1
answer
277
views
Laravel tinker not showing opcache working
This is my OpCache configuration:
opcache.consistency_checks => 0 => 0
opcache.dups_fix => Off => Off
opcache.enable => On => On
opcache.enable_cli => Off => Off
opcache....
0
votes
1
answer
744
views
Does PHP OPcache also cache the file load from file_get_contents()?
I was not able to find an answer to my question in the docs or by a few hours of googling.
Essentially, it all boils down to whether this code can be cached by OPcache including the json file itself:
...
0
votes
1
answer
174
views
ini_get_all('Zend OPcache') echos warning that the extension couldn't be found
I have an app where the user or rather the admin, can check the configuration of PHP. Cause it is an API the ini values are collected by calling ini_get_all with all the extension names.
This is the ...
1
vote
2
answers
4k
views
Can't enable Zend OpCache on AlmaLinux and PHP8
I'm using AlmaLinux 8.4, and I'm trying to install Zend Opcache and verify that it's running.
In Easy Apache, php8 and php80-php-opcache are installed. php -1 shows Zend is not enabled, while php -a ...
-1
votes
1
answer
517
views
phpinfo() shows opcache.blacklist_filename file, but contents ignored
In my Symfony/Sonata application's php.ini file, I have opcache.blacklist_filename set to /usr/src/app/config/opcache-exclude.txt. In a phpinfo() call on my test server, that file shows up in the ...
1
vote
1
answer
5k
views
OPcache interned strings buffer size lower than "opcache.interned_strings_buffer"
I recognised that the interned strings buffer size, reported by opcache_get_status() is always smaller than the assigned value of opcache.interned_strings_buffer, returned also by ...
0
votes
1
answer
1k
views
Install php-opcache for PHP installed via Remi's repository
I have an environment with the following setup:
Centos/RHEL 8
PHP 7.4 installed from Remi's repository
I have set installed php like so:
sudo dnf -y install https://dl.fedoraproject.org/pub/epel/...
0
votes
1
answer
719
views
XDebug configured and installed but not working
I followed instructions how to install xdebug.
So, I created file with phpinfo() function, that returns me php info.
Then copied php info and used xdebug wizard: https://xdebug.org/wizard
That returns ...
5
votes
1
answer
2k
views
What is causing a segfault when Opcache file cache is enabled in a symlink deployment?
I'm using PHP deployer which is a symlink based deployment tool which calls opcache:reset after deployment.
Recently I'm getting a segfault in my PHP-FPM processes after deployment.
This manifests as ...
1
vote
0
answers
142
views
PHP Invalid output of get_class_vars() after enabling (opcache.so) extension [duplicate]
I have this simple code that demonstrates updating a static value:
<?php
class myClass
{
// empty static var
public static $prop1;
}
myClass::$prop1 = array("Hey, I'm setting your ...
0
votes
0
answers
196
views
Should I use OPcache for simple PHP website
I've a PHP website (all files has .php extension), where most of the pages only contains few (5 to 6) PHP include statement to include header, footer, menu, etc. which are common to all pages, and the ...
1
vote
1
answer
692
views
OPcache class preloading | where is the preload file generated by cache:clear command? [duplicate]
I'm using Symfony 4.4 with PHP 7.4.7
The Symfony documentation indicates that cache:clear command will generate a "file called preload.php in the config/ directory"
(see https://symfony.com/...
0
votes
1
answer
3k
views
Opcache disabled in php.ini, but active
I'm setting up a new webserver with PHP 7.4, Nginx, and ubuntu 20.
php.ini uses default settings and all opcache options are commented.
[opcache]
; Determines if Zend OPCache is enabled
;opcache....