Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Apc Bundle Laravel Package

symbio/apc-bundle

Symfony bundle for APC/APCu cache management, providing cache clearing, statistics, and a web interface to inspect cached keys. It helps developers debug and manage application cache contents from within Symfony.

View on GitHub
Deep Wiki
Context7

Provide a command line to clear APC cache from the console.

Frequently asked questions about Apc Bundle
What is symbio/apc-bundle used for?
It is a Symfony bundle that adds APC/APCu cache management to a Symfony application. It gives you console commands for clearing the cache, container services you can inject where needed, and tooling for inspecting cached keys and statistics. It is mainly useful after deployments, configuration changes or code updates, when stale cache entries need to be flushed so the application runs against a consistent state.
How do I install symbio/apc-bundle with Composer?
Install it with composer require symbio/apc-bundle, then enable the bundle in your application kernel or config/bundles.php depending on your Symfony version. The bundle is intentionally lightweight, so no configuration file is required for the basic cache-clearing commands. Make sure the matching PHP extension is present on the machine, either apcu for modern PHP or the older apc extension.
How do I clear the APC cache from the Symfony console?
The bundle registers console commands for clearing APC cache, so you can run them through bin/console like any other Symfony command. Run php bin/console list to see the exact command name and options exposed by your installed version. Keep in mind that APC/APCu storage is per SAPI and per process, so clearing from the CLI only affects the CLI cache, not the cache held by PHP-FPM workers serving web requests.
Does symbio/apc-bundle work with APCu or only the legacy APC extension?
The bundle targets APC and APCu cache management, and APCu is the extension you will normally use on PHP 7 and later since the opcode-cache portion of APC was removed. APCu still exposes the apc_* functions for user cache operations, which is what cache clearing and statistics rely on. Check that apcu.enabled is on for the SAPI you are clearing, otherwise the commands will report an empty or unavailable cache.
Which Symfony and PHP versions does symbio/apc-bundle support?
Support depends on the release you install, so check the require and conflict constraints in the package composer.json or on its Packagist page before upgrading. Older tagged versions may target Symfony 2, 3 or 4, while newer tags are needed for Symfony 5, 6 and 7 projects. If you are on a current Symfony release and the constraint does not allow it, test the bundle in a branch before relying on it in production.
How do I register and configure the bundle in a Symfony application?
On Symfony 4 and later, add the bundle class to config/bundles.php; on older versions, register it in the registerBundles method of AppKernel. The minimal setup needs no configuration at all, since the console commands and container services work out of the box. If your version ships a configuration tree, you can optionally import it under a bundle-specific key in config/packages to tune defaults.
Can I use symbio/apc-bundle in a Laravel application?
No. This is a Symfony bundle that depends on the Symfony kernel, dependency injection container and console component, so it will not work as a drop-in Laravel package. Laravel applications should use the framework cache abstraction with an APCu-capable store, or a Laravel-specific APC/APCu cache driver package. Calling APCu functions such as apcu_clear_cache directly from a Laravel command is another simple option.
How do I access APC cache services from the Symfony service container?
The bundle exposes container services for cache operations, so you can autowire or fetch them in your own services, commands and controllers. Use php bin/console debug:container with a bundle-related filter to list the exact service ids for your installed version. This lets you trigger cache resets from application code, for example at the end of a deployment task or an admin action.
Can I automate APC cache clearing after every deployment?
Yes, add the bundle's clear command to your deploy script, typically after the release is published or the symlink is switched. Because the CLI process has its own APC/APCu memory, the web-facing cache is only cleared if the command hits the same SAPI, which for FPM usually means calling a protected web endpoint or reloading the workers. Reloading PHP-FPM after the command is a reliable way to guarantee the web cache starts empty.
How do I inspect cached keys with the web interface, and is it safe to clear cache in production?
The bundle can expose a web interface for browsing cached keys and statistics alongside the console commands, which is useful for debugging unexpected cache contents in development or staging. Clearing the APC/APCu cache in production is generally safe because the data is regenerable, but expect a short performance dip while entries are rebuilt. Restrict the inspection route to trusted users or disable it in production, since exposing cache keys and values can leak sensitive information.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core