13.11.2025 | Nikolas Kopp

Clear APC & Opcache

clear_cache.php
<?php

apcu_clear_cache();
opcache_reset();

Issue:

You need to clear APC and Opcache, e.g. for debugging purposes.

Solution:

drush php:script clear_cache 

This snippet clears APCu and Opcache. Put it into the docroot. Execute from browser, not from CLI.

See the drush documentation for more info.