• Resolved hupe13

    (@hupe13)


    • WordPress: 7.0-beta1
    • php 8.5
    • opcache enabled (file)

    The site health tests the existence of opcache in includes/class-wp-site-health.php:

    2803: if ( function_exists( 'opcache_get_status' ) ) 

    But opcache_get_status “will not return any information about the file cache”. It returns false and site health reports “Opcode cacheDisabled”.

    Is this check right? Searching the internet I get many answers about activating opcache. Most of them are about activating “opcache file cache”.

    • This topic was modified 1 month, 1 week ago by hupe13.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @hupe13, you’ve diagnosed this correctly. It’s a bug.

    opcache_get_status() intentionally returns false in file_cache_only mode (PHP documents this). So when only file-based opcache is active, WordPress incorrectly reports it as disabled.

    The fix is to fall back to opcache_get_configuration(), which does work in file-cache-only mode, and check for opcache.enable, opcache.file_cache, and opcache.file_cache_only being set. Worth opening a Trac ticket.

    Thread Starter hupe13

    (@hupe13)

    I will open a trac ticket.

    https://core.trac.ww.wp.xz.cn/ticket/64707

    • This reply was modified 1 month, 1 week ago by hupe13. Reason: ticked number
Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.