• Resolved George

    (@georgew751)


    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 to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author nierdz

    (@mnttech)

    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

    (@georgew751)

    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

    (@mnttech)

    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

    (@georgew751)

    Works great with PHP 7.1.15.

    Thanks!!

    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 6 years, 7 months ago by joe2night.
    Plugin Author nierdz

    (@mnttech)

    Hi, I just released a new version to address this issue : 2.4.1
    Can you try it and tell me how it works ?

    It works, thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Flushing the PHP file cache’ is closed to new replies.