- Create a PHP file with this content:
- Load this PHP file via your web server
Note: This technique doesn't work in the command console, so you cannot execute
php -r "opcache_reset();"in your terminal to delete OPcache contents.
Reload the PHP module/daemon used by the web server and the OPcache contents will be deleted:
# when using mod_php and Apache $ apachectl graceful # when using PHP-FPM $ service php-fpm reload