PHPackages                             webfixit/opcache - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. webfixit/opcache

ActiveMagento2-module[CLI &amp; Console](/categories/cli)

webfixit/opcache
================

Allows the purge/clear/flush of the PHP OpCache via the CLI and Magento2 Backend

1.2.0(8y ago)2726.4k7[1 issues](https://github.com/wiardvanrij/m2-opcache-manager/issues)OSL-3.0PHP

Since Nov 16Pushed 5y ago4 watchersCompare

[ Source](https://github.com/wiardvanrij/m2-opcache-manager)[ Packagist](https://packagist.org/packages/webfixit/opcache)[ RSS](/packages/webfixit-opcache/feed)WikiDiscussions development Synced 1mo ago

READMEChangelog (4)DependenciesVersions (8)Used By (0)

Magento2 OpCache Manager
========================

[](#magento2-opcache-manager)

Allows the purge/clear/flush of the PHP OpCache via the CLI and Magento2 Backend

Unmaintained
============

[](#unmaintained)

I still see a lot of activity on this repository (usage). I just wanted to note that I'm not maintaining this plugin anymore. This is because I'm not working with Magento at this point. Therefore I have no interest in making new changes/features. Though feel free to make pull-requests and I will process these.

Why
---

[](#why)

Because PHP OpCache is almost the de facto standard in current server/application setups. Most users/developers are usinga simple PHP script to clear the cache or simply ignore this cache. With this extension you can use it in your build/deployment process via the CLI. Also provided is an extension to the Magento2 backend. With a simple click you can purge the cache.

About me
--------

[](#about-me)

I'm a DevOps engineer for a full service digital agency in the Netherlands. When possible I try to create opensource scripts / extentions and tools. If you appriciate my work, please be so kind to donate so I can keep drinking beer.

[![paypal](https://camo.githubusercontent.com/e1ff554a09e8e92bef25abc553ff05b88f45afd695877cf12f3a46558ef65b2e/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UDG2ZGDZ9TMEE)

How the CLI works
-----------------

[](#how-the-cli-works)

It is simply not possible to clear the php OpCache via the CLI. I have created a workaround for that. Instead of actually running a static PHP file from the CLI, we do a curl request. Because it is a curl request, your webserver actually will parse this request via the "php cgi". This way we can clear it.

The issue we now have is that we do not want robots or "hackers" to be able to clear this cache. Therefor on execution we write a sort of "lock" file. Obviously removing it after clearing. This way "direct access" to this static page is not possible.

### Additional cache management extended

[](#additional-cache-management-extended)

[![Magento2 Additional cache management](https://camo.githubusercontent.com/443d46645915c11e58300e6143f44e53a52dd5e64007f79b73452c6b09035d4e/68747470733a2f2f73797372616e742e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31312f312d312e706e67)](https://camo.githubusercontent.com/443d46645915c11e58300e6143f44e53a52dd5e64007f79b73452c6b09035d4e/68747470733a2f2f73797372616e742e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31312f312d312e706e67)

### OpCache purge

[](#opcache-purge)

[![Magento2 OpCache purge](https://camo.githubusercontent.com/c2f4f37fd50cbf157660f70ea3c81d80707858666877b5a22489e164db3339a3/68747470733a2f2f73797372616e742e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31312f322e706e67)](https://camo.githubusercontent.com/c2f4f37fd50cbf157660f70ea3c81d80707858666877b5a22489e164db3339a3/68747470733a2f2f73797372616e742e636f6d2f77702d636f6e74656e742f75706c6f6164732f323031372f31312f322e706e67)

### CLI Usage

[](#cli-usage)

```
php bin/magento opcache:status
```

Returns the opcache status:

```
bin/magento opcache:status
Array
(
    [opcache_enabled] => 1
    [cache_full] =>
    [restart_pending] =>
    [restart_in_progress] =>
    [memory_usage] => Array
        (
            [used_memory] => 78587744
            [free_memory] => 2068895904
            [wasted_memory] => 0
            [current_wasted_percentage] => 0
        )

    [interned_strings_usage] => Array
        (
            [buffer_size] => 20971520
            [used_memory] => 2283208
            [free_memory] => 18688312
            [number_of_strings] => 41723
        )

    [opcache_statistics] => Array
        (
            [num_cached_scripts] => 1289
            [num_cached_keys] => 1365
            [max_cached_keys] => 130987
            [hits] => 6
            [start_time] => 1510859030
            [last_restart_time] => 0
            [oom_restarts] => 0
            [hash_restarts] => 0
            [manual_restarts] => 0
            [misses] => 1289
            [blacklist_misses] => 0
            [blacklist_miss_ratio] => 0
            [opcache_hit_rate] => 0.46332046332046
        )

)
```

```
php bin/magento opcache:clear
```

Will clear the PHP OpCache

```
bin/magento opcache:clear
Cleared OpCache
```

Install with Composer
---------------------

[](#install-with-composer)

```
composer require webfixit/opcache
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 70% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~58 days

Total

4

Last Release

2930d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75a4dd4094cca0b6b256d9ef693893fe973687932619eb235a4c354c680b47de?d=identicon)[wiardvanrij](/maintainers/wiardvanrij)

---

Top Contributors

[![wiardvanrij](https://avatars.githubusercontent.com/u/5786097?v=4)](https://github.com/wiardvanrij "wiardvanrij (7 commits)")[![osrecio](https://avatars.githubusercontent.com/u/1510831?v=4)](https://github.com/osrecio "osrecio (2 commits)")[![paulvandermeijs](https://avatars.githubusercontent.com/u/513046?v=4)](https://github.com/paulvandermeijs "paulvandermeijs (1 commits)")

---

Tags

climagentomagento-2magento-2-extensionmagento-extensionmagento-modulemagento2magento2-backendmagento2-extensionmagento2-moduleopcachephpphp-opcachephp7

### Embed Badge

![Health badge](/badges/webfixit-opcache/health.svg)

```
[![Health](https://phpackages.com/badges/webfixit-opcache/health.svg)](https://phpackages.com/packages/webfixit-opcache)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
