• After updating W3 Total Cache I receive the following error:

    Warning: require_once(/home2/gearrkr/public_html/wp-content/plugins/w3-total-cache.:/opt/php54/lib/php): failed to open stream: No such file or directory in /home2/gearrkr/public_html/wp-content/object-cache.php on line 19
    
    Fatal error: require_once(): Failed opening required '/home2/gearrkr/public_html/wp-content/plugins/w3-total-cache.:/opt/php54/lib/php' (include_path='.:/opt/php54/lib/php') in /home2/gearrkr/public_html/wp-content/object-cache.php on line 19

    Despite different attempts to repair the code, as per error receive, I still cannot access the dashboard or website.

    Here is the original syntax of the file defined above. Any ideas on the correct syntax to repair the code below based on the error message above?

    <?php
    
    /**
     * W3 Total Cache Object Cache
     */
    if (!defined('W3TC_DIR')) {
        define('W3TC_DIR', WP_CONTENT_DIR . '/plugins/w3-total-cache');
    }
    
    if (!@is_dir(W3TC_DIR) || !file_exists(W3TC_DIR . '/inc/define.php')) {
        if (!defined('WP_ADMIN')) { // lets don't show error on front end
            require_once (ABSPATH . WPINC . '/cache.php');
        } else {
            @header('HTTP/1.1 503 Service Unavailable');
            die(sprintf('<strong>W3 Total Cache Error:</strong> some files appear to be missing or out of place. Please re-install plugin or remove <strong>%s</strong>.', __FILE__));
        }
    } else {
        require_once W3TC_DIR . '/inc/define.php';
        require_once W3TC_LIB_W3_DIR .'/ObjectCache.php';
    
        /**
         * Init cache
         *
         * @return void
         */
        function wp_cache_init() {
            $GLOBALS['wp_object_cache'] = & W3_ObjectCache::instance();
        }
    
        /**
         * Reset cache
         *
         * @return boolean
         */
        function wp_cache_reset() {
            return true;
        }
    
        /**
         * Close cache
         *
         * @return boolean
         */
        function wp_cache_close() {
            return true;
        }
    
        /**
         * Get from cache
         *
         * @param string $id
         * @param string $group
         * @return mixed
         */
        function wp_cache_get($id, $group = 'default') {
            global $wp_object_cache;
    
            return $wp_object_cache->get($id, $group);
        }
    
        /**
         * Set cache
         *
         * @param string $id
         * @param mixed $data
         * @param string $group
         * @param integer $expire
         * @return boolean
         */
        function wp_cache_set($id, $data, $group = 'default', $expire = 0) {
            global $wp_object_cache;
    
            return $wp_object_cache->set($id, $data, $group, $expire);
        }
    
        /**
         * Delete from cache
         *
         * @param string $id
         * @param string $group
         * @return boolean
         */
        function wp_cache_delete($id, $group = 'default') {
            global $wp_object_cache;
    
            return $wp_object_cache->delete($id, $group);
        }
    
        /**
         * Add data to cache
         *
         * @param string $id
         * @param mixed $data
         * @param string $group
         * @param integer $expire
         * @return boolean
         */
        function wp_cache_add($id, $data, $group = 'default', $expire = 0) {
            global $wp_object_cache;
    
            return $wp_object_cache->add($id, $data, $group, $expire);
        }
    
        /**
         * Replace data in cache
         *
         * @param string $id
         * @param mixed $data
         * @param string $group
         * @param integer $expire
         * @return boolean
         */
        function wp_cache_replace($id, $data, $group = 'default', $expire = 0) {
            global $wp_object_cache;
    
            return $wp_object_cache->replace($id, $data, $group, $expire);
        }
    
        /**
         * Flush cache
         *
         * @return boolean
         */
        function wp_cache_flush() {
            global $wp_object_cache;
    
            return $wp_object_cache->flush();
        }
    
        /**
         * Add global groups
         *
         * @param array $groups
         * @return void
         */
        function wp_cache_add_global_groups($groups) {
            global $wp_object_cache;
    
            $wp_object_cache->add_global_groups($groups);
        }
    
        /**
         * add non-persistent groups
         *
         * @param array $groups
         * @return void
         */
        function wp_cache_add_non_persistent_groups($groups) {
            global $wp_object_cache;
    
            $wp_object_cache->add_nonpersistent_groups($groups);
        }
    }
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • Inside your wp-config.php file remove the define('WP_CACHE', true); line

    Thread Starter dudewalker

    (@dudewalker)

    Kimberly,

    Thank you for the suggestion.

    Unfortunately, it did not appear to work.

    Ok, delete the wp-content/w3tc-config directory and if you see an advanced-cache.php, db-cache.php, and object-cache.php files in the wp-content dir then delete those too.

    We are just trying to restore access to your admin page.

    • This reply was modified 7 years, 9 months ago by Kimberly.
    Thread Starter dudewalker

    (@dudewalker)

    Kimberly, thanks again for the suggestion.

    I will keep that in mind if this happens again.

    Work around as follows: renamed that file [email protected] [~/public_html/wp-content]# mv objectcache.php object-cache.php.back

    Was able to access wp-admin, then deleted the W3 Total Cache plugin.

    It appears that others are having similar issues as well.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘W3 Total Cache Error Line 19’ is closed to new replies.