Jetpack Asset CDN PHP 8.x Fatal (photon-cdn.php:298): Fix & Workarounds

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?

  1. WP‑CLI (best): SSH into the server and run:
    wp plugin deactivate jetpack

    Now you can log in to wp‑admin. Re‑enable Jetpack later and disable only Asset CDN (see below).

  2. No SSH? Rename the 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?

Option A - WordPress Admin (fastest)

  1. Go to Jetpack → Settings → Performance.
  2. Under Performance & speed, turn Speed up static file load times off. (This is the Asset CDN.)

Option B - WP‑CLI

Deactivate only the Asset CDN module:

wp jetpack module deactivate photon-cdn

Option C - Temporary MU‑plugin (survives plugin updates)

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?

  • Update Jetpack and WooCommerce to the latest versions once available, then test Asset CDN again in staging.
  • Clear caches (plugin/server/CDN/browser) after toggling Asset CDN so you’re not served stale references.
  • Reset the stored Asset CDN list (optional) if it grew inconsistent:
    wp option delete jetpack_static_asset_cdn_files

    Jetpack will rebuild it when needed.

  • Re‑enable carefully: When a fix ships, remove the MU‑plugin (if you used it) and/or run:
    wp jetpack module activate photon-cdn

I only need a quick “do this now” checklist. Can you summarize?

  1. Locked out? wp plugin deactivate jetpack (or rename the plugin folder) → log in.
  2. Re‑enable Jetpack, then disable only Asset CDN:
    • UI: Jetpack → Settings → Performance → turn off “Speed up static file load times”.
    • or WP‑CLI: wp jetpack module deactivate photon-cdn
    • or MU‑plugin: add the snippet above.
  3. Clear caches. Test. Keep Jetpack features you need.
  4. When the upstream fix is available, update and re‑enable Asset CDN; remove the MU‑plugin override.

If you need hands-on help, our team can diagnose and patch safely.