Title: Enabling cache causes PHP errors
Last modified: July 1, 2024

---

# Enabling cache causes PHP errors

 *  Resolved [Steven Davis](https://wordpress.org/support/users/stevendavis2018/)
 * (@stevendavis2018)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/enabling-cache-causes-php-errors/)
 * After enabling the cache feature I received the error below:
 * [30-Jun-2024 04:02:47 UTC] PHP Fatal error: Uncaught Error: Call to undefined
   function wp_cache_get() in /volume1/web/familyhistories/wp-includes/option.php:
   602
   Stack trace: 0 /volume1/web/familyhistories/wp-includes/option.php(164): 
   wp_load_alloptions() 1 /volume1/web/familyhistories/wp-includes/l10n.php(63):
   get_option(‘WPLANG’) 2 /volume1/web/familyhistories/wp-includes/l10n.php(165):
   get_locale() 3 /volume1/web/familyhistories/wp-includes/l10n.php(1369): determine_locale()
   4 /volume1/web/familyhistories/wp-includes/l10n.php(1400): _load_textdomain_just_in_time(‘
   wp-optimize’) 5 /volume1/web/familyhistories/wp-includes/l10n.php(194): get_translations_for_domain(‘
   wp-optimize’) 6 /volume1/web/familyhistories/wp-includes/l10n.php(306): translate(‘
   User is logged …’, ‘wp-optimize’) 7 /volume1/web/familyhistories/wp-content/plugins/
   wp-optimize/cache/file-based-page-cache-functions.php(38): __(‘User is logged…’,‘
   wp-optimize’) 8 [internal function]: wpo_cache(‘…’, 9)

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

 *  [wpmansour](https://wordpress.org/support/users/wpmansour/)
 * (@wpmansour)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/enabling-cache-causes-php-errors/#post-17863417)
 * I’m sorry you’re experiencing PHP errors after enabling the cache feature. It
   looks like the error involves an undefined function related to caching. Could
   you let me know if you have any other caching plugins installed or if there have
   been any recent changes to your site’s configuration? Also, try clearing your
   cache in all forms, including browser cache and any server-side cache, to see
   if that resolves the issue. This information will help me diagnose the issue 
   more effectively.
 *  Thread Starter [Steven Davis](https://wordpress.org/support/users/stevendavis2018/)
 * (@stevendavis2018)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/enabling-cache-causes-php-errors/#post-17863959)
 * I do not have any specific caching plugins except WP-Optomize. The only other
   plugin, I am aware of, that uses caching is Smart Slider. I cleared the caches
   in Smart Slider and WP-Optomize.
 * My site has slowed down after the last few WP upgrades. No idea why as I have
   not added / changed any pages or added any plugins. I did have a few large packet
   errors, this year, which I have not seen in the previous eight years of using
   WP.
 * “WordPress database error Got a packet bigger than ‘max_allowed_packet’ bytes
   for query UPDATE `wpfh1_options` SET `option_value`.”
 * These packet errors range in size from 2,101kb to 10,151kb in size.
 *  [wpmansour](https://wordpress.org/support/users/wpmansour/)
 * (@wpmansour)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/enabling-cache-causes-php-errors/#post-17864354)
 * Thanks for the additional details, Steven. Given that you only have WP-Optimize
   and Smart Slider using caching, and considering the recent packet errors you 
   mentioned, it sounds like there might be an underlying issue with your database
   configuration or the size of the data being handled.
 * Here are a few steps to troubleshoot and potentially resolve the issue:
    1. **Contact Hosting Provider to Increase `max_allowed_packet` Size**:
    2.  - The `max_allowed_packet` setting in your MySQL configuration controls the
          maximum size of a packet that can be sent. Please contact your hosting provider
          and ask them to increase this value to 64M ( `max_allowed_packet=64M`) if
          it is currently set to a lower value. After this change, they will need to
          restart the MySQL server.
    3. **Disable and Re-enable WP-Optimize Cache**:
    4.  - Sometimes, simply toggling the cache settings can help resolve configuration
          issues. Disable the cache in WP-Optimize, clear all caches, and then re-enable
          it.
    5. **Check for Large Options**:
    6.  - Large options stored in the database can cause performance issues. Check 
          your `wp_options` table for any unusually large entries and consider cleaning
          them up if necessary.
 * Additionally, it’s important to note that your server plays a major role in the
   performance of your site. If your server is under heavy load or has limited resources,
   it can significantly slow down your site. Ensuring your server has adequate resources
   and is well-configured can help improve your site’s performance.
 * Please try these steps and let me know if the issue persists. If you continue
   to experience problems, we might need to look deeper into your server configuration
   and logs for more insights.
 *  Thread Starter [Steven Davis](https://wordpress.org/support/users/stevendavis2018/)
 * (@stevendavis2018)
 * [1 year, 10 months ago](https://wordpress.org/support/topic/enabling-cache-causes-php-errors/#post-17864493)
 * Thank you for the response. The packet size has been increased.

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

The topic ‘Enabling cache causes PHP errors’ is closed to new replies.

 * ![](https://ps.w.org/wp-optimize/assets/icon-256x256.png?rev=1552899)
 * [WP-Optimize – Cache, Compress images, Minify & Clean database to boost page speed & performance](https://wordpress.org/plugins/wp-optimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-optimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-optimize/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-optimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-optimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-optimize/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Steven Davis](https://wordpress.org/support/users/stevendavis2018/)
 * Last activity: [1 year, 10 months ago](https://wordpress.org/support/topic/enabling-cache-causes-php-errors/#post-17864493)
 * Status: resolved