Your site crashes with a fatal error like array_keys(): Argument #1 ($array) must be of type array, null given in /wp-content/plugins/jetpack/modules/photon-cdn.php:298 after enabling Jetpack’s Site Accelerator (Asset CDN) on PHP 8.x. This guide gives fast recovery steps (WP‑CLI/UI), a safe way to disable only the Asset CDN, and a cleanup checklist so you can keep Jetpack active until the upstream fix lands.
My site crashes on PHP 8.2/8.4 when Jetpack Site Accelerator is on. Error: array_keys(): null in /wp-content/plugins/jetpack/modules/photon-cdn.php:298. What’s going on?
That fatal is thrown inside Jetpack’s Asset CDN (“Site Accelerator” for core/Jetpack/WooCommerce CSS/JS). When it builds the list of assets to serve from the CDN, a null is being passed where an array is expected, which triggers a PHP 8.x TypeError. The symptom is consistent with recent reports tied to photon-cdn.php.
Good news: you can disable only the Asset CDN and keep the rest of Jetpack running.
I can’t access wp-admin. How do I recover quickly?
wp plugin deactivate jetpack
Now you can log in to wp‑admin. Re‑enable Jetpack later and disable only Asset CDN (see below).
wp-content/plugins/jetpack folder via your host’s File Manager/FTP to disable it, log in, then restore the folder name.How do I disable only the Jetpack Asset CDN and keep Jetpack active?
Deactivate only the Asset CDN module:
wp jetpack module deactivate photon-cdn
Create wp-content/mu-plugins/disable-jetpack-asset-cdn.php with:
<?php
/*
Plugin Name: Disable Jetpack Asset CDN (Temporary)
Description: Force‑disable Jetpack’s Asset CDN module.
*/
add_filter( 'option_jetpack_active_modules', function( $modules ) {
$i = array_search( 'photon-cdn', $modules, true );
if ( false !== $i ) {
unset( $modules[ $i ] );
}
return array_values( $modules );
} );
This removes only the Asset CDN while keeping other Jetpack features on.
Will turning off Asset CDN break my site or WooCommerce?
No. Jetpack’s Site Accelerator replaces some core/Jetpack/WooCommerce CSS/JS with CDN URLs. Turning it off simply serves those assets from your local site again. Functionality stays intact; you may see a small performance dip until you re‑enable it.
What else should I check to prevent the error from coming back?
wp option delete jetpack_static_asset_cdn_files
Jetpack will rebuild it when needed.
wp jetpack module activate photon-cdn
I only need a quick “do this now” checklist. Can you summarize?
wp plugin deactivate jetpack (or rename the plugin folder) → log in.wp jetpack module deactivate photon-cdnIf you need hands-on help, our team can diagnose and patch safely.