diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index 44c04175abaf2..2beff559ff621 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -2800,10 +2800,19 @@ public function get_test_search_engine_visibility() { */ public function get_test_opcode_cache(): array { $opcode_cache_enabled = false; - if ( function_exists( 'opcache_get_status' ) ) { - $status = @opcache_get_status( false ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged -- Warning emitted in failure case. - if ( $status && true === $status['opcache_enabled'] ) { + if ( extension_loaded( 'Zend OPcache' ) ) { + $enabled = ini_get( 'opcache.enable' ); + + if ( $enabled ) { $opcode_cache_enabled = true; + + // Only try to read status if it actually works. + if ( function_exists( 'opcache_get_status' ) ) { + $status = @opcache_get_status( false ); + if ( is_array( $status ) && isset( $status['opcache_enabled'] ) ) { + $opcode_cache_enabled = (bool) $status['opcache_enabled']; + } + } } } diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index b655af53f0cb6..864f65b5ee104 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -218,7 +218,7 @@ function display_setup_form( $error = null ) { die( '
' . __( 'You appear to have already installed WordPress. To reinstall please clear your old database tables first.' ) . '
' . - '' . + '' . '