WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: DB Cache Reloaded] getting a fatal error (26 posts)

  1. Ovidiu
    Member
    Posted 4 years ago #

    after activation seeing this in my log and the blog goes white:

    PHP Fatal Error: cannot redeclare class wpdb in ....../db.php on line 83

    http://wordpress.org/extend/plugins/db-cache-reloaded/

  2. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    Do you get this error every time? Or only once, e.g. after activating plugin?

  3. Ovidiu
    Member
    Posted 4 years ago #

    let me rephrase:

    I activate the plugin all looks good, but after activating it, the back end and the front end, both display a blank white page.

    I then check the error log and see that error every time I tried to acces the blog. I delete the filedb.php and all is good btu the caching then doesn't seem to happen. so I deactivated the plugin again.

  4. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    I have updated plugin, so it detects such situations and displays custom error message in admin section. When you have PHP 5 and Reflection extension loaded, it additionally shows file where wpdb class was previously defined.

    Please upgrade to version 1.1.

  5. Ovidiu
    Member
    Posted 4 years ago #

    ok, seems to work now, but in the source code of my site, I always see output like this:

    <!-- Generated in 1.691 seconds. Made 91 queries to database and 0 cached queries. Memory used - 36.23MB -->
    <!-- Cached by DB Cache Reloaded -->

    it always says 0 cached queries so it seems ineffctive on my site :-(

    follow the link and check it out: http://pacura.ru

  6. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    Do you have any warning message displayed in admin section? DB Cache Reloaded should display it if it will detect that wpdb class is already loaded.

    Which WP version do you use?

    Please also check your WP files. On my install (WP 2.8.4) following files are loaded before wp-content/db.php:
    index.php
    wp-blog-header.php
    wp-load.php
    wp-config.php
    wp-settings.php
    wp-includes/compat.php
    wp-includes/functions.php
    wp-includes/classes.php

    or (for admin section):

    wp-admin/options-general.php
    wp-admin/admin.php
    wp-load.php
    wp-config.php
    wp-settings.php
    wp-includes/compat.php
    wp-includes/functions.php
    wp-includes/classes.php

    Please check these files to make sure they are the same as in official WP archive (except for wp-config). If you have changed them (e.g. wp-config), please check your changes.

  7. Ovidiu
    Member
    Posted 4 years ago #

    hey,

    what do you mean by admin section? do you mean on your plugins settings page? if so there are no errors or warnings.

    I am on 2.8.4 and yes, my wp-config has been modified quite heavily. i.e. for use with the wp-tuner plugin, etc.

    shall I post a version without my salts and secrets and passwords onto pastebin?

    Oh, and wp-settings I have modified too, for wp-tuner. but those changes should not be a problem...

  8. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    Admin section = admin panel or backend (all pages within wp-admin/ dir).

    As I checked, WP Tuner plugin is responsible for this problem. I have notified its author about this issue - hope it will correct it and release new version soon.

  9. Ovidiu
    Member
    Posted 4 years ago #

    great. will wait for the update then. the author of wp-tuner is pretty good at implementing changes, although a little slow to catch up sometimes. :-)

    will post again later, after a wp-tuner upgrade or try and disable that plugin for now :-)

  10. datacode
    Member
    Posted 4 years ago #

    I'm getting the error upon activation...
    Fatal error: Call to a member function load() on a non-object in /nfs/c12/h12/mnt/12345/domains/dev.thedomain.com/html/wp-content/db.php on line 839

    Both the front end and back end error this way. Only way to fix is to remove the db.php file from wp-content manually.

    This is on WP 2.8.4 using DB Cache Reloaded 1.1 on a MediaTemple gs site.

  11. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    @datacode: which PHP version do you use?

    Please also check if upgrade to version 1.2 will help - I did some change in this version, which may help.

  12. Phoenixheart
    Member
    Posted 4 years ago #

    Hello,
    The same happens to me here: http://www.thica.net/ too. It seems DB Cache Reloaded has no effects:

    <!-- Generated in 1.816 seconds. Made 72 queries to database and 0 cached queries. Memory used - 14.66MB -->

    I'm using DreamHost, if that matters.

  13. Phoenixheart
    Member
    Posted 4 years ago #

    Yeah, and the same plugin version works very well on my localhost:

    <!-- Generated in 0.652 seconds. Made 4 queries to database and 77 cached queries. Memory used - 14.99MB -->

  14. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    @Phoenixheart: I have added some extra code to help diagnose such
    problems in last DB Cache Reloaded version - 1.4. It shows -1 as cached query count when there is a conflict with other plugin, and messages in admin backend. Could you check it and let me know if it displays them on your setup?

  15. Phoenixheart
    Member
    Posted 4 years ago #

    @sirzooro: Well, seems it was a problem with my hosting company. I switched host and DB Cache Reloaded works like a charm now. Great plugin!

  16. dbasulto
    Member
    Posted 4 years ago #

    For me, it crashes apache when enabled :(

    I use nginx as a transparent proxy...

  17. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    @Phoenixheart: good to hear that. BTW, which version of PHP you were using on DreamHost? I suspect that your problem may be related to PHP4.

    @dbasulto: do you run Apache on Windows or Linux/Unix? I had some Apache crashes on my dev machine (Windows XP Pro SP3), but I have not investigated this deeper.

  18. Ovidiu
    Member
    Posted 4 years ago #

    my pages are all showing this in the source:

    <!-- Generated in 1.445 seconds. Made 71 queries to database and -1 cached queries. Memory used - 36.51MB -->
    <!-- Cached by DB Cache Reloaded -->

    in the admin dashboard I see: `DB Cache Reloaded Error: wpdb class is redefined, plugin cannot work!
    Previous definition is at /var/www/clients/client1/web7/web/wp-includes/wp-db.php:53.andDB Cache Reloaded Error: DB Module (wpdb class) is not loaded. Please open the Options Page, disable caching (remember to save options) and enable it again. If this will not help, please check FAQ how to do manual upgrade.`

    following that advice doesn't help...

    then I remembered the incompatibility with wp-tuner, disabled taht one e voila: `<!-- Generated in 1.386 seconds. Made 5 queries to database and 66 cached queries. Memory used - 35.46MB -->
    <!-- Cached by DB Cache Reloaded -->
    `

    but now that wp-tuenr doesn't work, how do I check the speed improvement? is hte figure reported by DB cache reloaded: 1.386 seconds without the caching or with the caching?

  19. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    @Ovidiu: you can compare numbers displayed in these footer comments with caching enabled and disabled. You posted two such numbers: 1.445 sec without caching (when you had WP Tuner enabled), and 1.386 sec with caching (when you disabled WP Tuner). So there is small improvement, but numbers are still high. Please check if you have some plugin which is written in really inefficient way (try disabling all plugins one by one, or install fresh WP copy on subdomain), or your server is overloaded. You can use DB Cache Reloaded plugin to check page loading time.

  20. Ovidiu
    Member
    Posted 4 years ago #

    here are some examples with caching:

    <!-- Generated in 1.488 seconds. Made 5 queries to database and 66 cached queries. Memory used - 35.46MB -->
    <!-- Generated in 1.995 seconds. Made 5 queries to database and 66 cached queries. Memory used - 35.46MB -->
    <!-- Generated in 1.295 seconds. Made 5 queries to database and 66 cached queries. Memory used - 35.46MB -->
    <!-- Generated in 1.453 seconds. Made 5 queries to database and 66 cached queries. Memory used - 35.46MB -->
    <!-- Generated in 1.539 seconds. Made 5 queries to database and 66 cached queries. Memory used - 35.46MB -->

    and some without caching:
    <!-- Generated in 2.380 seconds. Made 71 queries to database and 0 cached queries. Memory used - 35.34MB -->
    <!-- Generated in 1.608 seconds. Made 71 queries to database and 0 cached queries. Memory used - 35.34MB -->
    <!-- Generated in 1.807 seconds. Made 71 queries to database and 0 cached queries. Memory used - 35.34MB -->

    looks pretty random to me. maybe its not the DB calls slowing down the page?

    btw. can you also contribute to this thread, maybe? http://wordpress.org/support/topic/320578?replies=3

  21. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    In case of such variation of results you need to calculate average. In this case average time for caching enabled is 1.55 sec, and for caching disabled is 1.93 sec.

    Also please take a look on this thread.

  22. sdhunt
    Member
    Posted 4 years ago #

    sirzooro, I've been using DB Cache Reloaded for several weeks without a problem. It's been great.
    Then all of a sudden this morning I found my blog had gone to a blank white page. The admin section was unaffected so I tried disabling DB Cache Reloaded and the site returned. I had not added/updated any plugins or edited the theme.
    So, I'm puzzled as to why this is happening. I tried clearing the cache but that didn't help. Now, whenever I enable DB my blog goes blank and whenever I disable it the site loads correctly.

    Any thoughts on what I can do about this?

  23. dbasulto
    Member
    Posted 4 years ago #

    @sirzooro,

    Apache, on CentOS.

  24. knightnet
    Member
    Posted 4 years ago #

    I installed WP Tuner this afternoon, working fine. Then I installed DB Cache Reloaded. It gives the error noted at the start of this thread. Tried de/re activating. Disabled WP Tuner, the cache works. Reenable WP Tuner and it refuses to start.

  25. trusktr
    Member
    Posted 4 years ago #

    oooof, my blog stopped working. I posted a topic about it.

    I have removed the plugin, which removed the error mesage, but now everything is all white.

  26. Daniel Fru?y?ski (sirzooro)
    Member
    Posted 4 years ago #

    I saw in other thread that you was able to remove plugin successfully.

    As I wrote, I plan to add WPMU support in next version.

Topic Closed

This topic has been closed to new replies.

About this Topic