Title: Call to undefined function wp_cache_setting()
Last modified: November 6, 2017

---

# Call to undefined function wp_cache_setting()

 *  [jomo](https://wordpress.org/support/users/jonathanmoorebcsorg/)
 * (@jonathanmoorebcsorg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/)
 * Suprised to see this in the logs on latest version:
 *     ```
       PHP Fatal error:  Uncaught Error: Call to undefined function wp_cache_setting() in wp-content/plugins/wp-super-cache/wp-cache-phase1.php:988
       Stack trace:
       #0 wp-content/plugins/wp-super-cache/wp-cache-phase1.php(577): wpsc_create_debug_log('0c3689a829a7c7c...', '5015baad81dcbd8...')
       #1 wp-content/plugins/wp-super-cache/wp-cache-phase1.php(427): wp_cache_debug('wp_cache_get_co...', 5)
       #2 wp-content/plugins/wp-super-cache/wp-cache-phase1.php(120): wp_cache_get_cookies_values()
       #3 wp-content/plugins/wp-super-cache/wp-cache-phase1.php(126): get_wp_cache_key()
       #4 wp-content/plugins/wp-super-cache/wp-cache-phase1.php(157): wp_super_cache_init()
       #5 wp-content/plugins/wp-super-cache/wp-cache-phase1.php(383): wp_cache_serve_cache_file()
       #6 wp-content/advanced-cache.php(21): include_once('/home/...')
       #7  in wp-content/plugins/wp-super-cache/wp-cache-phase1.php on line 988
       ```
   

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

 *  [calang](https://wordpress.org/support/users/calang/)
 * (@calang)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9654352)
 * I am having a similar issue. It started this afternoon.
 * The error first appeared when I updated under construction plugin. I’ve now deactivated
   and removed it and deleted cache. In the admin area I get the error when I try
   to access certain admin areas.
 *  Thread Starter [jomo](https://wordpress.org/support/users/jonathanmoorebcsorg/)
 * (@jonathanmoorebcsorg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9654365)
 * well that code path is only if debug logging is enabled, so you can just turn
   that off..
 *  [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9655285)
 * Hi [@jonathanmoorebcsorg](https://wordpress.org/support/users/jonathanmoorebcsorg/),
 * Stack trace shows that function `wp_cache_setting` is called before plugin is
   fully loaded. In this case it’s possible fatal error. You should replace code(
   wp-cache-phase1.php:988):
 *     ```
       wp_cache_setting( 'wp_cache_debug_log', $wp_cache_debug_log );
       wp_cache_setting( 'wp_cache_debug_username', $wp_cache_debug_username );
       ```
   
 * with:
 *     ```
       if ( function_exists( 'wp_cache_setting' ) ) {
           wp_cache_setting( 'wp_cache_debug_log', $wp_cache_debug_log );
           wp_cache_setting( 'wp_cache_debug_username', $wp_cache_debug_username );
       }
       ```
   
 * It’s quick workaround and probably it isn’t perfect. I see more issues related
   to debug logging and this code probably needs more improvements.
 * Regards,
    Sasa
 *  Thread Starter [jomo](https://wordpress.org/support/users/jonathanmoorebcsorg/)
 * (@jonathanmoorebcsorg)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9655346)
 * Well yes I agree… another quick workaround is to turn the debug logging off 🙂
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9656154)
 * I fixed the issue [here](https://github.com/Automattic/wp-super-cache/pull/443).
   I’m going to merge this with the development version of the plugin shortly and
   it will stop the issue happening, while still allowing you to debug. 🙂
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9656200)
 * The development version has been updated, so if this happens to you, give it 
   a go by downloading it from the following page:
 * [https://odd.blog/y/2o](https://odd.blog/y/2o)
 *  [abuzon](https://wordpress.org/support/users/abuzon/)
 * (@abuzon)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9761048)
 * I tried downloading a replacing all files as instructed in the link by [@donncha](https://wordpress.org/support/users/donncha/)
   and still had the same line 988 error.
 * Tried turning off logging of debug.
 * Still can’t even access my website- thehelpfulmarketer.com . Tried [@stodorovic](https://wordpress.org/support/users/stodorovic/)’
   s recommendation of replacing the code on line 988 and now I get this error:
   
   Parse error: syntax error, unexpected end of file in /home1/thehelt1/public_html/
   wp-content/plugins/wp-super-cache/wp-cache-phase1.php on line 1174
 *  [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9761131)
 * Hi [@abuzon](https://wordpress.org/support/users/abuzon/)
 * I think that you forgot to put second ‘}’. I’ll copy here more lines to you can
   easy copy code:
 *     ```
               $fp = fopen( $cache_path . $wp_cache_debug_log, 'w' );
               if ( $fp ) {
                       fwrite( $fp, '<' . "?php\n" );
                       fwrite( $fp, $msg );
                       fwrite( $fp, '?' . "><pre>" . PHP_EOL );
                       fwrite( $fp, '<' . '?php // END HEADER ?' . '>' . PHP_EOL );
                       fclose( $fp );
                       if ( function_exists( 'wp_cache_setting' ) ) {
                               wp_cache_setting( 'wp_cache_debug_log', $wp_cache_debug_log );
                               wp_cache_setting( 'wp_cache_debug_username', $wp_cache_debug_username );
                       }  
               }
               $fp = fopen( $cache_path . 'view_' . $wp_cache_debug_log, 'w' );
       ```
   
 * Just add `if ( function_exists( 'wp_cache_setting' ) ) {` before line 988 and`}`
   after line 990.
 * I hope that helps,
    Sasa
    -  This reply was modified 8 years, 6 months ago by [Saša](https://wordpress.org/support/users/stodorovic/).
 *  [abuzon](https://wordpress.org/support/users/abuzon/)
 * (@abuzon)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9761281)
 * Thank you [@stodorovic](https://wordpress.org/support/users/stodorovic/) you 
   might be right!
    So I just did it again and I’m still getting the Fatal error
   on line 988. My website is totally down and I’m trying to win a client right 
   now! This is SO BAD! I even tried deleting the plugin and was STILL getting this
   error even with a cleared browser cache. How is that possible?? Any help is greatly
   appreciated!!
 * Fatal error: Uncaught Error: Call to undefined function wp_cache_setting() in/
   home1/thehelt1/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.
   php:988 Stack trace: #0 /home1/thehelt1/public_html/wp-content/plugins/wp-super-
   cache/wp-cache-phase1.php(577): wpsc_create_debug_log(‘5fcd10dcae042e8…’, ‘b7aff7fa19a2f89…’)#
   1 /home1/thehelt1/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.
   php(427): wp_cache_debug(‘wp_cache_get_co…’, 5) #2 /home1/thehelt1/public_html/
   wp-content/plugins/wp-super-cache/wp-cache-phase1.php(51): wp_cache_get_cookies_values()#
   3 /home1/thehelt1/public_html/wp-content/advanced-cache.php(20): include_once(‘/
   home1/thehelt1…’) #4 /home1/thehelt1/public_html/wp-settings.php(84): include(‘/
   home1/thehelt1…’) #5 /home1/thehelt1/public_html/wp-config.php(84): require_once(‘/
   home1/thehelt1…’) #6 /home1/thehelt1/public_html/wp-load.php(37): require_once(‘/
   home1/thehelt1…’) #7 /home1/thehelt1/public_html/wp-blog-header.php(13): require_once(‘/
   home1/thehelt1…’) #8 /home1/t in /home1/thehelt1/public_html/wp-content/plugins/
   wp-super-cache/wp-cache-phase1.php on line 988
 *  [Saša](https://wordpress.org/support/users/stodorovic/)
 * (@stodorovic)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9761349)
 * Quick and fast solution is adding two lines from previous post.
 * If you afraid to do it again, then it’s possible alternative solution, replacing
   lines 998 and 999:
 *     ```
       wp_cache_setting( 'wp_cache_debug_log', $wp_cache_debug_log );
       wp_cache_setting( 'wp_cache_debug_username', $wp_cache_debug_username );
       ```
   
 * with
 *     ```
       function_exists( 'wp_cache_setting' ) && wp_cache_setting( 'wp_cache_debug_log', $wp_cache_debug_log );
       function_exists( 'wp_cache_setting' ) && wp_cache_setting( 'wp_cache_debug_username', $wp_cache_debug_username );
       ```
   
 * If you want to remove plugin, then please follow these instructions after deactivation
   of plugin (You need FTP access):
    [https://github.com/Automattic/wp-super-cache/wiki/In-An-Emergency](https://github.com/Automattic/wp-super-cache/wiki/In-An-Emergency)
 * I recommend to you just add `function_exists( 'wp_cache_setting' ) &&` before`
   wp_cache_setting` at lines 998 and 999. It’s the fastest solution.
    -  This reply was modified 8 years, 6 months ago by [Saša](https://wordpress.org/support/users/stodorovic/).
 *  [abuzon](https://wordpress.org/support/users/abuzon/)
 * (@abuzon)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9761509)
 * Thanks again [@stodorovic](https://wordpress.org/support/users/stodorovic/)
    
   I did just that. I quadruple checked the code when I did it the 2nd time and 
   that error just was NOT going away. I finally just removed the plugin to get 
   my site back up and installed a different caching plugin. 🙁 But my site is back
   up! 🙂
 *  Plugin Author [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * (@donncha)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9762683)
 * The development version of the plugin has a fix for this. Grab it here:
    [http://ocaoimh.ie/y/2o](http://ocaoimh.ie/y/2o)

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

The topic ‘Call to undefined function wp_cache_setting()’ is closed to new replies.

 * ![](https://ps.w.org/wp-super-cache/assets/icon-256x256.png?rev=3506220)
 * [WP Super Cache](https://wordpress.org/plugins/wp-super-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-super-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-super-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-super-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-super-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-super-cache/reviews/)

 * 12 replies
 * 5 participants
 * Last reply from: [Donncha O Caoimh (a11n)](https://wordpress.org/support/users/donncha/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-function-wp_cache_setting/#post-9762683)
 * Status: not resolved