obive.net

Friday May 20 2022 @ 2:09 AM

One of the big downsides to enabling Opcache in PHP is that you lose hot-reloading of changed scripts. One way to get that ability back is to use IDEA File Watchers.

First, implement an endpoint in your application to clear caches:

apcu_clear_cache();
opcache_reset();

Then, add a new File Watcher that invokes that endpoint:

Mission accomplished!