• Resolved jackstron

    (@jackstron)


    I am using a 2nd database in the same MySQL server running the latest WP 5.4, latest MYSQL, and latest W3 Cache on Ubuntu 18. I am saving to this database logs which I want to keep separate from my primary WordPress installation. I am using the WP syntax to access another database. However, when using 2nd database with activated caching, I get this:

    Attempt to create object of class W3TC\Exception has been made, but file /var/www/myroot/htdocs/wp-content/plugins/w3-total-cache/Exception.php doesnt exists#0 w3tc_class_autoload(W3TC\Exception) #1 spl_autoload_call(W3TC\Exception) called at [/var/www/myroot/htdocs/wp-content/plugins/w3-total-cache/DbCache_WpdbNew.php:25] #2 W3TC\DbCache_WpdbNew->__construct(admin, ‘PASSWORD’, logging, localhost) called at [/var/www/myroot/htdocs/wp-content/themes/polly/inc/theme-settings.php:146] #3 require_once(/var/www/myroot/htdocs/wp-content/themes/polly/inc/theme-settings.php) called at [/var/www/myroot/htdocs/wp-content/themes/polly/functions.php:37] #4 include(/var/www/myroot/htdocs/wp-content/themes/polly/functions.php) called at [/var/www/myroot/htdocs/wp-settings.php:497] #5 require_once(/var/www/myroot/htdocs/wp-settings.php) called at [/var/www/myroot/htdocs/wp-config.php:135] #6 require_once(/var/www/myroot/htdocs/wp-config.php) called at [/var/www/myroot/htdocs/wp-load.php:37] #7 require_once(/var/www/myroot/htdocs/wp-load.php) called at [/var/www/myroot/htdocs/wp-blog-header.php:13] #8 require(/var/www/myroot/htdocs/wp-blog-header.php) called at [/var/www/myroot/htdocs/index.php:17]
    Fatal error: Uncaught Error: Class ‘W3TC\Exception’ not found in /var/www/myroot/htdocs/wp-content/plugins/w3-total-cache/DbCache_WpdbNew.php:25 Stack trace: #0 /var/www/myroot/htdocs/wp-content/themes/polly/inc/theme-settings.php(146): W3TC\DbCache_WpdbNew->__construct(‘admin’, ‘PASSWORD’, ‘logging’, ‘localhost’) #1 /var/www/myroot/htdocs/wp-content/themes/polly/functions.php(37): require_once(‘/var/www/myroot…’) #2 /var/www/myroot/htdocs/wp-settings.php(497): include(‘/var/www/myroot…’) #3 /var/www/myroot/htdocs/wp-config.php(135): require_once(‘/var/www/myroot…’) #4 /var/www/myroot/htdocs/wp-load.php(37): require_once(‘/var/www/myroot…’) #5 /var/www/myroot/htdocs/wp-blog-header.php(13): require_once(‘/var/www/myroot…’) #6 /var/www/myroot/htdocs/index.php(17): require(‘/var/www/myroot…’) #7 {main} thrown in /var/www/myroot/htdocs/wp-content/plugins/w3-total-cache/DbCache_WpdbNew.php on line 25

    Looks like a problem which has not been predicted by developers…?

    • This topic was modified 4 years, 12 months ago by jackstron.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @jackstron

    I am sorry about the issue you are experiencing and I am happy to assist you with this.
    We are checking this and will reply as soon as we replicate the issue and investigate.
    Thank you!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @jackstron
    Thank you for your patience.
    Can you please change to following:
    In /wp-content/plugins/w3-total-cache/DbCache_WpDbNew.php

    replaceon line 25:
    throw new Exception( 'called incorrectly, use instance()' );
    with
    throw new \Exception( 'called incorrectly, use instance()' );

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error message when using Database caching with 2nd database’ is closed to new replies.