Disabling APCu and OPcache is definitely the wrong way to solve such issues, as it dramatically decreases performance for requests when PHP is involved, or beaks the application completely.
APCu is only used when the application is actively configured to do so, and then there is usually an option to clear the cache manually, when required. When the PHP module is disabled (by (re)moving the file), the application is broken, will throw an error page as fast as it attempts to read or write to the cache. So before ever doing something, first the application needs to be configured to not use APCu anymore, but that is not recommended. When the application still works after disabling the PHP module, then it was not used and it had no effect that the module was disabled
.
OPcache is automatically used, when enabled, and disabling it won’t break anything, but on each request, PHP has to read and compile the original PHP source file, which is a large overhead, compared to the optimised RAM-cached version, which OPcache serves. It has a mechanism to verify that the cached file still matches the original PHP file after a defined time, and we set that to 60 seconds indeed, which means that changes to local PHP files take up to 60 seconds before clients will see them. This is good for performance reasons, as also the validation takes time, but it is still much faster than parsing the origin file each time. If you need changes to take effect in under a minute, then I suggest doing the following (instead of disabling the OPcache):
echo -e '; Custom PHP overrides\n; priority=99\nopcache.revalidate_freq=1' > /etc/php/7.3/mods-available/custom.ini
phpenmod custom
This assumes PHP7.3 to be used, and the path hence needs to be changed on Debian Bullseye systems, which use PHP7.4 by default. It sets the re-validation to 1 second, so local PHP file changes are seen by clients after at max a second.
This way you have a transparent override for default PHP settings, which you can easily enable (phpenmod) and disable (phpdismod) or remove again without loosing the defaults or having custom changes reverted on an upgrade or reinstall.