Title: Uncaught TypeError
Last modified: June 10, 2022

---

# Uncaught TypeError

 *  Resolved [nmxde](https://wordpress.org/support/users/nmxde/)
 * (@nmxde)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-typeerror-62/)
 * Hello,
 * Using PHP8.1 I get this fatal error (works fine with 7.x and same configuration):
 *     ```
       wp-web-1 | 2022/06/10 20:44:28 [error] 30#30: *33 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught TypeError: flock(): supplied resource is not a valid stream resource in /var/www/html/wp-content/plugins/w3-total-cache/Cache_File.php:123
       wp-web-1 | Stack trace:
       wp-web-1 | #0 /var/www/html/wp-content/plugins/w3-total-cache/Cache_File.php(123): flock(Resource id #687, 3)
       wp-web-1 | #1 /var/www/html/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache_Regular.php(293): W3TC\Cache_File->set('0transientw3tc....', Array, 604800)
       wp-web-1 | #2 /var/www/html/wp-content/plugins/w3-total-cache/ObjectCache_WpObjectCache.php(50): W3TC\ObjectCache_WpObjectCache_Regular->set('w3tc.verify_plu...', true, 'transient', 604800)
       wp-web-1 | #3 /var/www/html/wp-content/object-cache.php(67): W3TC\ObjectCache_WpObjectCache->set('w3tc.verify_plu...', true, 'transient', 604800)
       wp-web-1 | #4 /var/www/html/wp-includes/option.php(937): wp_cache_set('w3tc.verify_plu...', true, 'transient', 604800)
       wp-web-1 | #5 /var/www/html/wp-content/plugins/w3-total-cache/Generic_Plugin_AdminCompatibility.php(60): set_transient('w3tc.verify_plu...', true, 604800)
       wp-web-1 | #6 /var/www/html/wp-includes/class-wp-hook.php(307): W3TC\Generic_Plugin_AdminCompatibility->verify('')
       wp-web-1 | #7 /var/www/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
       wp-web-1 | #8 /var/www/html/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
       wp-web-1 | #9 /var/www/html/wp-admin/admin-header.php(303): do_action('admin_notices')
       wp-web-1 | #10 /var/www/html/wp-admin/plugins.php(605): require_once('/var/www/html/w...')
       wp-web-1 | #11 {main}
       ```
   
 * Any help would be appreciated.
    Tobias

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

 *  Thread Starter [nmxde](https://wordpress.org/support/users/nmxde/)
 * (@nmxde)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-typeerror-62/#post-15727741)
 * I can access the admin area. The error occurs just when accessing content to 
   be cached. Just in case this is helpful to find the root cause (and not obvious
   anyhow).
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-typeerror-62/#post-15732091)
 * Hello [@nmxde](https://wordpress.org/support/users/nmxde/)
 * Thank you for reaching out and I am happy to assist you with this.
    Please go
   to W3TC settings in Performance>General Settings, scroll down to Miscellaneous,
   and see if the option “Enable file locking” is enabled? If so, please disable
   the option, save all settings, purge the cache, and see if the problem persists?
   Thanks!
 *  Thread Starter [nmxde](https://wordpress.org/support/users/nmxde/)
 * (@nmxde)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-typeerror-62/#post-15751453)
 * Hi Marko.
 * Sorry for the delay. Thanks for the useful and fast reply! This solved the problem.
   Is there anything to worry about not using file locking (when using local block
   storage)?
 * Thanks again,
    Tobias
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-typeerror-62/#post-15752260)
 * Hello [@nmxde](https://wordpress.org/support/users/nmxde/)
 * Thank you for your feedback.
    File locking may cause problems on some environments.
   And to answer your question, no there is nothing to worry about if the option
   is disabled, in fact, it’s not enabled by default. Thanks!
 *  Thread Starter [nmxde](https://wordpress.org/support/users/nmxde/)
 * (@nmxde)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-typeerror-62/#post-15752265)
 * Perfect. Thanks!
 *  Plugin Contributor [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * (@vmarko)
 * [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-typeerror-62/#post-15752331)
 * Hello [@nmxde](https://wordpress.org/support/users/nmxde/)
 * You are most welcome!
 * We would really appreciate it if you could take a minute and post a review [here](https://wordpress.org/support/plugin/w3-total-cache/reviews/).
   This will help us to continue offering a top-notch product to users.
    Thanks!

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

The topic ‘Uncaught TypeError’ is closed to new replies.

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

 * 6 replies
 * 2 participants
 * Last reply from: [Marko Vasiljevic](https://wordpress.org/support/users/vmarko/)
 * Last activity: [3 years, 11 months ago](https://wordpress.org/support/topic/uncaught-typeerror-62/#post-15752331)
 * Status: resolved