Title: Fatal error with PHP version 8.1
Last modified: November 8, 2022

---

# Fatal error with PHP version 8.1

 *  Resolved [lavendel2](https://wordpress.org/support/users/lavendel2/)
 * (@lavendel2)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-with-php-version-8-1/)
 * Hi,
 * When the Super Page Cache for Cloudflare is enabled (together with EDD 3.x); 
   and I purchase a product on the checkout of the Easy Digital Downloads store;
   a fatal error will be displayed:
 * `Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback)
   must be a valid callback, array must have exactly two members in /home/runcloud/
   webapps/mainFV/wp-includes/class-wp-hook.php:310 Stack trace: #0 /home/runcloud/
   webapps/mainFV/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #
   1 /home/runcloud/webapps/mainFV/wp-includes/plugin.php(517): WP_Hook->do_action()#
   2 /home/runcloud/webapps/mainFV/wp-content/plugins/easy-digital-downloads/includes/
   orders/functions/orders.php(1196): do_action() #3 /home/runcloud/webapps/mainFV/
   wp-content/plugins/easy-digital-downloads/includes/payments/functions.php(141):
   edd_build_order() #4 /home/runcloud/webapps/mainFV/wp-content/plugins/edd-recurring/
   includes/gateways/edd-recurring-gateway.php(640): edd_insert_payment() #5 /home/
   runcloud/webapps/mainFV/wp-content/plugins/edd-recurring/includes/gateways/edd-
   recurring-gateway.php(579): EDD_Recurring_Gateway->record_signup() #6 /home/runcloud/
   webapps/mainFV/wp-includes/class-wp-hook.php(308): EDD_Recurring_Gateway->process_checkout()#
   7 /home/runcloud/webapps/mainFV/wp-includes/class-wp-hook.php(332): WP_Hook->
   apply_filters() #8 /home/runcloud/webapps/mainFV/wp-includes/plugin.php(517):
   WP_Hook->do_action() #9 /home/runcloud/webapps/mainFV/wp-content/plugins/easy-
   digital-downloads/includes/gateways/functions.php(404): do_action() #10 /home/
   runcloud/webapps/mainFV/wp-content/plugins/easy-digital-downloads/includes/process-
   purchase.php(193): edd_send_to_gateway() #11 /home/runcloud/webapps/mainFV/wp-
   includes/class-wp-hook.php(308): edd_process_purchase_form() #12 /home/runcloud/
   webapps/mainFV/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #
   13 /home/runcloud/webapps/mainFV/wp-includes/plugin.php(517): WP_Hook->do_action()#
   14 /home/runcloud/webapps/mainFV/wp-content/plugins/easy-digital-downloads/includes/
   actions.php(56): do_action() #15 /home/runcloud/webapps/mainFV/wp-includes/class-
   wp-hook.php(308): edd_post_actions() #16 /home/runcloud/webapps/mainFV/wp-includes/
   class-wp-hook.php(332): WP_Hook->apply_filters() #17 /home/runcloud/webapps/mainFV/
   wp-includes/plugin.php(517): WP_Hook->do_action() #18 /home/runcloud/webapps/
   mainFV/wp-settings.php(617): do_action() #19 /home/runcloud/webapps/mainFV/wp-
   config.php(86): require_once('...') #20 /home/runcloud/webapps/mainFV/wp-load.
   php(50): require_once('...') #21 /home/runcloud/webapps/mainFV/wp-blog-header.
   php(13): require_once('...') #22 /home/runcloud/webapps/mainFV/index.php(17):
   require('...') #23 {main} thrown in /home/runcloud/webapps/mainFV/wp-includes/
   class-wp-hook.php on line 310`
 * The fatal error will be removed once I disable the WP CF page cache plugin.
 * Can you please have a look at why this fatal error is popping up when the plugin
   is enabled?
 * Thanks in advance.

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

 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-with-php-version-8-1/#post-16181659)
 * Hi,
    just looked at the code of the plugin and don’t see any issues inside the
   plugin code that may cause this issue.
 * The settings mentioned here: [https://i.imgur.com/qmm4WCu.jpeg](https://i.imgur.com/qmm4WCu.jpeg)
   
   are handled like this: [https://i.imgur.com/ZFo6Qwx.jpeg](https://i.imgur.com/ZFo6Qwx.jpeg)
   Where it is using `edd_get_option('purchase_page', 0)`, `edd_get_option('success_page',
   0)`, `edd_get_option('failure_page', 0)`, `edd_get_option('purchase_history_page',
   0)`, `edd_get_option('login_redirect_page', 0)` – to determine which EDD page
   it is.
 * Then for this option: [https://i.imgur.com/F6isasM.jpeg](https://i.imgur.com/F6isasM.jpeg)
   
   It is using the `edd_insert_payment` hook ([https://docs.easydigitaldownloads.com/article/719-eddinsertpayment](https://docs.easydigitaldownloads.com/article/719-eddinsertpayment))
   which according to the doc has 2 arguments – to purge the cache. So, if EDD has
   made any changes in the new update that they didn’t update in the docs, then 
   I am not aware of it.
 * But still, can you try [downloading this version of the plugin](https://verti-artifacts.s3.amazonaws.com/WP-Cloudflare-Super-Page-Cache-development-f2adeab5/wp-cloudflare-page-cache.zip)
   on your site and see if it resolves your issue?
 * Let me know.
 *  Thread Starter [lavendel2](https://wordpress.org/support/users/lavendel2/)
 * (@lavendel2)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-with-php-version-8-1/#post-16181743)
 * Hello [@isaumya](https://wordpress.org/support/users/isaumya/) — thanks a lot
   for getting back to me.
 * I downloaded the new version of your plugin and installed it on the website. 
   I turned on PHP version 8.1 and made a test transaction from our front. Unfortunately,
   it’s returning the same fatal error as explained above.
 * I also tried to disable the EDD settings (disabling flush) but that’s also resulting
   in the same error.
 * I just downgraded to version 8.0 and that does seem to work with the new version
   of your plugin. Are there significant features not working on 8.0 compared to
   8.1?
 *  Thread Starter [lavendel2](https://wordpress.org/support/users/lavendel2/)
 * (@lavendel2)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-with-php-version-8-1/#post-16181791)
 * BTW, your support is really helpful.
 * Thumbs up for that!
 *  [adisaputro25](https://wordpress.org/support/users/adisaputro25/)
 * (@adisaputro25)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-with-php-version-8-1/#post-16182127)
 * I’m running this plugin on php8.1 with no issues.
 *  Plugin Contributor [iSaumya](https://wordpress.org/support/users/isaumya/)
 * (@isaumya)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-with-php-version-8-1/#post-16182134)
 * Hi [@lavendel2](https://wordpress.org/support/users/lavendel2/),
    if you are 
   still having the same issue I’m 100% sure that it is not coming from the plugin.
   The reason I am saying that is there is just 1 edd hook that this plugin uses
   as I showed you. I am also using this plugin on many 8.1 sites (thought they 
   are not running EDD) including my own sites without any issues.
 * Does the problem go away when you disable this plugin?
 * As I’ve shared above all the ways this plugin talks to EDD, none of them seems
   to match the error that you have shared.

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

The topic ‘Fatal error with PHP version 8.1’ 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/)

 * 7 replies
 * 3 participants
 * Last reply from: [iSaumya](https://wordpress.org/support/users/isaumya/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/fatal-error-with-php-version-8-1/#post-16182134)
 * Status: resolved