Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Clear PHP Caches

No security coverage Maintenance fixes only 7 sites

This module allows administrators to clear PHP APC and OPCache caches directly from the Drupal administration interface. It provides a simple, secure way to flush PHP memory and opcode caches, eliminating the need for server access or hosting support.

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/clearphpcaches

Enable the module at Administration > Extend or via Drush:

drush en clearphpcaches

First Steps:

  1. After enabling, navigate to Administration > People > Permissions
  2. Search for "Clear PHP Caches" and grant the permission to trusted administrator roles
  3. If Admin Toolbar is enabled, the "Clear APC and OPCache" item now appears under Flush in the admin toolbar
  4. 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
Drupal 10–11

Ask your assistant about Clear PHP Caches

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
5
Tracked since
Sep 2024
Latest release
1 month ago
Releases (12 mo)
2
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.2.0 Stable 10–11 Aug 28, 2026
2.x-dev Dev 11 Aug 28, 2026
1.1.0 Stable 10–11 Oct 25, 2024
1.0.x-dev Dev 10–11 Oct 25, 2024
1.0.0 Stable 10 Sep 5, 2024