Title: Flushing the PHP file cache
Last modified: March 30, 2018

---

# Flushing the PHP file cache

 *  Resolved [George](https://wordpress.org/support/users/georgew751/)
 * (@georgew751)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/flushing-the-php-file-cache/)
 * I have the PHP 7.1 file-based Opcode cache enabled in addition to the In-Memory
   OpCache:
    opcache.file_cache=/usr/home/altopl/public_html/.opcache
 * As far as I can tell, when I click on “Flush PHP OPcache,” it only flushes/purges
   the In-Memory cache. I have to manually remove the file-based OPcache–which then
   gets automatically recreated the next time when I access my site.
 * Would it be possible to add the file cache flushing to the “Flush PHP OPcache”
   functionality in some future release?
 * Thanks much,
    George Wilder
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fflushing-the-php-file-cache%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [nierdz](https://wordpress.org/support/users/mnttech/)
 * (@mnttech)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/flushing-the-php-file-cache/#post-10148931)
 * Hi George,
 * This is a really nice idea, I’ll work on this feature during next weekend.
    Could
   you post me your opcache configuration please ?
 * ++
 *  Thread Starter [George](https://wordpress.org/support/users/georgew751/)
 * (@georgew751)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/flushing-the-php-file-cache/#post-10150005)
 * Hi mnttech,
 * Thanks for the response.
 * I am on a pair Networks shared host, which has ssh access. I am running PHP 7.1.
   This is my OpCache configuration:
 * 1738c1738,1739
    < ;opcache.enable=0 — > zend_extension=opcache.so > opcache.enable
   =1 1769c1770 < ;opcache.revalidate_freq=2 — > opcache.revalidate_freq=60 1840c1841
   < ;opcache.file_cache= — > opcache.file_cache=/usr/home/altopl/public_html/.opcache
 * To “flush” my file cache, I do:
 * ==> rm -rf ~/public_html/.opcache/*
 * Then I click on the “Flush PHP OPcache” button that was installed by your plugin.
 * The file cache is automatically recreated the next time a PHP script is executed.
 * Thanks,
    George
 *  Plugin Author [nierdz](https://wordpress.org/support/users/mnttech/)
 * (@mnttech)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/flushing-the-php-file-cache/#post-10158932)
 * I just released 2.4 version with support for opcache.file_cache.
    Let me know
   if it works correctly on your php version. I only tried on 7.0.28-1.
 * ++
 *  Thread Starter [George](https://wordpress.org/support/users/georgew751/)
 * (@georgew751)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/flushing-the-php-file-cache/#post-10161394)
 * Works great with PHP 7.1.15.
 * Thanks!!
 *  [joe2night](https://wordpress.org/support/users/joe2night/)
 * (@joe2night)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/flushing-the-php-file-cache/#post-10161580)
 * Hello,
 * I just updated to the latest version of the plugin, but I can’t empty the cache
   any more.
    I receive this error: PHP Fatal error: Uncaught UnexpectedValueException:
   RecursiveDirectoryIterator::__construct(/tmp/opcache): failed to open dir: No
   such file or directory in /var/www/[…]/wp-content/plugins/flush-opcache/flush-
   opcache.php:288
 * I beleive this is because I don’t use file cache, and the new version of the 
   plugin does not handle this situation. I tried to create the folder /tmp/opcache(
   with correct permissions), but the error persists.
 * It would be nice to fix this bug, because it pretty much renders useless this
   plugin for those who have only memory cache.
 * Thanks!
 * PHP version:
    PHP 7.0.19-1 (cli) (built: May 11 2017 14:04:47) ( NTS ) Copyright(
   c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
   with Zend OPcache v7.0.19-1, Copyright (c) 1999-2017, by Zend Technologies
    -  This reply was modified 8 years, 1 month ago by [joe2night](https://wordpress.org/support/users/joe2night/).
 *  Plugin Author [nierdz](https://wordpress.org/support/users/mnttech/)
 * (@mnttech)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/flushing-the-php-file-cache/#post-10164807)
 * Hi, I just released a new version to address this issue : 2.4.1
    Can you try 
   it and tell me how it works ?
 *  [joe2night](https://wordpress.org/support/users/joe2night/)
 * (@joe2night)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/flushing-the-php-file-cache/#post-10164898)
 * It works, thanks!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Flushing the PHP file cache’ is closed to new replies.

 * ![](https://ps.w.org/flush-opcache/assets/icon-256x256.jpg?rev=1716642)
 * [WP OPcache](https://wordpress.org/plugins/flush-opcache/)
 * [Support Threads](https://wordpress.org/support/plugin/flush-opcache/)
 * [Active Topics](https://wordpress.org/support/plugin/flush-opcache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/flush-opcache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/flush-opcache/reviews/)

 * 7 replies
 * 3 participants
 * Last reply from: [joe2night](https://wordpress.org/support/users/joe2night/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/flushing-the-php-file-cache/#post-10164898)
 * Status: resolved