This project is not covered by Drupal’s security advisory policy.
About
Clear PHP Caches allows administrators to clear PHP APC and OPCache caches from Drupal without requiring direct server access. This module provides a simple, secure administration interface for flushing PHP memory and opcode caches — eliminating the need to SSH into your server or contact hosting support.
Whether you're deploying code changes, troubleshooting performance issues, or managing a multi-server environment, Clear PHP Caches gives your team the tools to clear caches directly from the Drupal administration interface.
Features
- One-Click Cache Clearing — Clear PHP APC and OPCache with a single click from the admin toolbar
- Permission-Based Access Control — Restrict cache clearing to trusted administrators using Drupal's permission system
- Admin Toolbar Integration — Seamless integration with Admin Toolbar for quick access under the "Flush" menu
- Direct URL Access — Access the cache clearing function via /admin/flush/phpcaches for scripting and automation
- Success Feedback — Immediate confirmation message after caches are cleared
- Smart Redirects — Automatically returns you to the previous page after clearing
- Zero Configuration — Works immediately after installation with no setup required
Requirements
Drupal: 10 or 11
PHP: 8.1 or higher with APCu and OPCache extensions enabled
Dependencies:
- Admin Toolbar (optional, but recommended for menu integration)
Note: The module works without Admin Toolbar, but you'll need to access the cache clearing function via the direct URL at /admin/flush/phpcaches.
Getting Started
Installation:
composer require drupal/clearphpcachesEnable the module at Administration > Extend or via Drush:
drush en clearphpcachesFirst Steps:
- After enabling, navigate to Administration > People > Permissions
- Search for "Clear PHP Caches" and grant the permission to trusted administrator roles
- If Admin Toolbar is enabled, the "Clear APC and OPCache" item now appears under Flush in the admin toolbar
- Click the menu item or visit /admin/flush/phpcaches to clear caches
Use Cases:
- Immediately clear caches after deploying code changes
- Troubleshoot performance issues by flushing opcode caches
- Automate cache clearing in CI/CD pipelines via direct URL access
- Reduce hosting support tickets by empowering administrators to clear caches
- Manage multi-server environments without SSH access
Project information
Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed.Maintenance fixes only
Considered feature-complete by its maintainers.11 sites report using this module
- Created by onfire84 on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.

