• Resolved JibsouX

    (@jibsoux)


    Hello !
    I come to you today because I have a problem with the administration of the plugin:
    After activating opcache on my shared server by creating the folder at the root “.opcache” and the file “php.ini” followed by a ssh command to propagate it in the directories.

    I can see the opcache folder filling up when I browse the site which tends to show that opcache is active.

    on the other hand in the administration of the plugin it is indicated :

    “Zend OPcache 0o memory of 0 files” :

    Web Server Apache
    PHP SAPI 8.0.17 / cgi-fcgi (Linux)
    Object Cache 4Mo object of 880 files
    Zend OPcache 0o memory of 0 files
    PHP Memory Limit 512Mo
    WP Frontend Memory Limit 512Mb
    WP Backend Memory Limit 256Mo
    Drop-in Writable Yes
    Drop-in File /wp-content/object-cache.php
    Cache Writable Yes
    Cache Files Limit 880 / 50000
    Cache Disk Limit 6Mo / 500Mo
    Cache Path /wp-content/cache/docket-cache
    Config Writable Yes
    Config Path /wp-content/docket-cache-data

    and when I go to the “OPcache Usage” page to view opcache I get the following error:

    Warning: Undefined array key “opcache_statistics” in /xxx/xxx/xxx/htdocs/Preprod/wp-content/plugins/docket-cache/includes/src/OPcacheView.php on line 93

    Warning: Undefined array key “memory_usage” in /xxx/xxx/xxx//htdocs/Preprod/wp-content/plugins/docket-cache/includes/src/OPcacheView.php on line 93

    Fatal error: Uncaught TypeError: array_merge(): Argument #1 must be of type array, null given in /xxx/xxx/xxx//htdocs/Preprod/wp-content/plugins/docket-cache/includes/src/OPcacheView.php:93 Stack trace: #0 /xxx/xxx/xxx//htdocs/Preprod/wp-content/plugins/docket-cache/includes/src/OPcacheView.php(93): array_merge(NULL, NULL) #1 /xxx/xxx/xxx/xxx//htdocs/Preprod/wp-content/plugins/docket-cache/includes/admin/opcviewer.php(98): Nawawi\DocketCacheOPcacheView->get_usage() #2 /xxx/xxx/xxx//htdocs/Preprod/wp-content/plugins/docket-cache/includes/src/View.php(198): include_once(‘/xxx/xxx/xxx…’) #3 /xxx/xxx/xxx//htdocs/Preprod/wp-content/plugins/docket-cache/includes/src/View.php(233): Nawawi\DocketCacheView->render(‘opcviewer’) #4 /xxx/xxx/xxx//htdocs/Preprod/wp-content/plugins/docket-cache/includes/admin/wrap.php(41): Nawawi\DocketCacheView->tab_content() #5 /xxx/xxx/xxx//htdocs/Preprod/wp-content/plugins/docket-cache/includes/src/View.php(198): include_once(‘/xxx/xxx/xxx…’) #6 /xxx/xxx/xxx/htdocs/Preprod/wp-content/plugins/docket-cache/includes/src/View.php(220): Nawawi\DocketCacheView->render(‘wrap’) #7 /xxx/xxx/xxx//htdocs/Preprod/wp-includes/class-wp-hook.php(307): Nawawi\DocketCacheView->index(”) #8 /xxx/xxx/xxx//htdocs/Preprod/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(”, Array) #9 /xxx/xxx/xxx//htdocs/Preprod/wp-includes/plugin.php(474): WP_Hook->do_action(Array) #10 /xxx/xxx/xxx//htdocs/Preprod/wp-admin/admin.php(259): do_action(‘docket-cache_pa…’) #11 {main} thrown in /xxx/xxx/xxx/htdocs/Preprod/wp-content/plugins/docket-cache/includes/src/OPcacheView.php on line 93

    Can you help me pls ?
    thanks in advance !

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Nawawi Jamili

    (@nawawijamili)

    Hi there,

    From the error display, seems “opcache_get_status” has been disabled. Docket Cache use this function to get OPcache stats.

    I didn’t test it much with PHP 8, since it should not throw any error if failed to get the configuration data.

    You may try to check in php.ini directive “disable_functions” if contains “opcache_get_status”. Remove it if you have permission to do it and restart the apache web server.

    Otherwise, I will fix this “error” issue in the next release.

    Thanks.

    • This reply was modified 2 years, 10 months ago by Nawawi Jamili.
    • This reply was modified 2 years, 10 months ago by Nawawi Jamili.
    Plugin Author Nawawi Jamili

    (@nawawijamili)

    Hi,

    It seems like I found what the issue is, you may have “opcache.file_cache_only=1” in your opcache configuration. You may try to set it to 0 “opcache.file_cache_only=0”, to make it only caching in shared memory.

    I will fix it in the next release to make it compatible with the “opcache.file_cache_only=1” configuration.

    Thanks.

    Thread Starter JibsouX

    (@jibsoux)

    @nawawijamili : indeed, passing the setting to 0 makes the admin page of the plugin work again, on the other hand the button flush OPcache does not remove the totality of the files in the folder “.opcache”, is it normal?

    Plugin Author Nawawi Jamili

    (@nawawijamili)

    @jibsoux

    The button only works if OPcache is in shared memory. Docket Cache uses the “opcache_reset” function to reset the OPcache usage. It may not remove the OPcache file in a local directory. You need to remove it manually and restart the php-fpm and apache services.

    Thanks.

    Thread Starter JibsouX

    (@jibsoux)

    Hello !
    Thank you for the quick response as always.
    Would it be possible to have the possibility to indicate a local opcache folder to change the behavior of the Flush Opcache button and thus empty the opcache folder via a php request?

    Plugin Author Nawawi Jamili

    (@nawawijamili)

    Hi,

    It is possible, but Docket Cache does not work properly when OPcache is not operating in shared memory. The reason is, Docket Cache store the cache as a php file, any changes require restarting the php-fpm service.

    This is next release file https://docketcache.com/devtest/docket-cache-21.08.xx-dev1.zip, you can try it first.

    Thanks.

    Plugin Author Nawawi Jamili

    (@nawawijamili)

    Hi,

    I’m marking this thread as resolved. Feel free to open a new topic if you have further questions.

    Thanks.

    Thread Starter JibsouX

    (@jibsoux)

    Hi @nawawijamili !
    Thanks for the beta update, this update is made to make Docket cache complient with opcache.file_cache_only=1 if opcache is in local ?

    Plugin Author Nawawi Jamili

    (@nawawijamili)

    @jibsoux

    No, it only fixes the error notice. Currently, we had some issues with login/authentication and I don’t have a timeframe for how long this can be fixed. For time being, Docket Cache can’t be used and is not compatible with opcache.file_cache_only=1.

    I hope this answers the question.

    Thanks.

    Update:

    Ok, this is a quick fix, you may try bypass “user_meta” groups from caching to fix the login issue. Place this code in the wp-config.php file.

    define('DOCKET_CACHE_IGNORED_GROUPS',
      [
        'counts',
        'plugins',
        'themes',
        'user_meta'
      ]
    );

    Thanks.

    • This reply was modified 2 years, 10 months ago by Nawawi Jamili.
    Plugin Author Nawawi Jamili

    (@nawawijamili)

    @jibsoux

    This is the latest dev file: https://docketcache.com/devtest/docket-cache-21.08.xx-dev2.zip

    This will fix “Flush OPcache”. Since OPcache will regenerate cache files quickly, you need to compare file timestamps. Or “Disable Object Cache” before flushing opcache and the “wp-content/cache/docket-cache” folder in the “.opcache” folder should be empty.

    No need to define DOCKET_CACHE_IGNORED_GROUPS constant as mentioned earlier.

    Thanks.

    Plugin Author Nawawi Jamili

    (@nawawijamili)

    @jibsoux

    This is the latest dev file that makes Docket Cache compatible with opcache.file_cache_only=1

    https://docketcache.com/devtest/docket-cache-21.08.xx-dev3.zip

    Thanks.

    Thread Starter JibsouX

    (@jibsoux)

    Wow Thanks !
    Everything works perfectly at all levels for the local opcache and opcache.file_cache_only=1; !

    Thanks !

    Plugin Author Nawawi Jamili

    (@nawawijamili)

    Thanks for your feedback!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Opcache activ, but “0octet no files” on plugin stats + bug’ is closed to new replies.