Title: PHP Warning: Trying to access array offset on null
Last modified: August 12, 2025

---

# PHP Warning: Trying to access array offset on null

 *  Resolved [wabetainfo](https://wordpress.org/support/users/wabetainfo/)
 * (@wabetainfo)
 * [9 months, 4 weeks ago](https://wordpress.org/support/topic/php-warning-trying-to-access-array-offset-on-null/)
 * Hi,
 * I have a cron job with the following command:
   `/usr/bin/php /home/user/public_html/
   folder/file.php`When it runs, I get this warning:`PHP Warning: Trying to access
   array offset on null in /home/user/public_html/wp-content/advanced-cache.php 
   on line 869`The mentioned line of code appears to be:`$excluded_urls = $swcfpc_config['
   cf_fallback_cache_excluded_urls'];`My settings are:Cache Engine: EnabledBackground
   Tasks: RunningCloudflare Caching: Inactive
 * I’m using version 5.1.4. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Kush](https://wordpress.org/support/users/kushnamdev/)
 * (@kushnamdev)
 * [9 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-trying-to-access-array-offset-on-null/#post-18602553)
 * Hi there,
 * Thanks for reporting this. The warning you’re seeing:
 *     ```wp-block-code
       PHP Warning: Trying to access array offset on null
       ```
   
 * usually happens when something is trying to read an array value that doesn’t 
   exist or is null. We’re not able to reproduce this on our side, so we’ll need
   a bit more detail to investigate:
    - The **full error message **(from your PHP error log).
    - Your **WordPress and PHP versions**.
 * With this information we can check if it’s coming directly from the plugin or
   being triggered by something else in your setup.
 * Best regards,
 *  Thread Starter [wabetainfo](https://wordpress.org/support/users/wabetainfo/)
 * (@wabetainfo)
 * [9 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-trying-to-access-array-offset-on-null/#post-18603992)
 * Hi,
   Thanks for your answer. The message I shared is already the full error message.
   There is nothing else.WordPress version is 6.8.2. PHP version is 8.3.
 *  Thread Starter [wabetainfo](https://wordpress.org/support/users/wabetainfo/)
 * (@wabetainfo)
 * [9 months, 1 week ago](https://wordpress.org/support/topic/php-warning-trying-to-access-array-offset-on-null/#post-18618560)
 * Hi [@kushnamdev](https://wordpress.org/support/users/kushnamdev/) 
   I have additional
   information to share. The PHP file includes:
 * do_action(“swcfpc_purge_cache”, array(
   “[https://example.com/url1&#8221](https://example.com/url1&#8221);,“
   [https://example.com/url2&#8221](https://example.com/url2&#8221);,“[https://example.com/url3&#8221](https://example.com/url3&#8221);));
 * The error occurs when this action is executed. It is probably not related to 
   the fact that it is called by a cron job, so my previous assumption was wrong.
   It is caused by this code. Thank you.
 *  Plugin Support [Kush](https://wordpress.org/support/users/kushnamdev/)
 * (@kushnamdev)
 * [8 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-trying-to-access-array-offset-on-null/#post-18641141)
 * It appears this thread is connected to this as you have confirmed as well, so
   I am closing this one and marking as resolved – [https://wordpress.org/support/topic/question-how-to-purge-cache-programmatically-from-php-using-swcfpc_purge_cache/](https://wordpress.org/support/topic/question-how-to-purge-cache-programmatically-from-php-using-swcfpc_purge_cache/)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘PHP Warning: Trying to access array offset on null’ is closed to new 
replies.

 * ![](https://ps.w.org/wp-cloudflare-page-cache/assets/icon-256x256.gif?rev=3234997)
 * [Super Page Cache – Cloudflare Cache, Page Speed & Core Web Vitals](https://wordpress.org/plugins/wp-cloudflare-page-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-cloudflare-page-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-cloudflare-page-cache/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Kush](https://wordpress.org/support/users/kushnamdev/)
 * Last activity: [8 months, 3 weeks ago](https://wordpress.org/support/topic/php-warning-trying-to-access-array-offset-on-null/#post-18641141)
 * Status: resolved