1

I recently updated to Joomla 3.8.1 and am getting warning messages on a certain page (below). If I turn off caching then the error goes away but I would like caching on.

Warning: mysqli::stat(): Couldn't fetch mysqli in /home/***/libraries/joomla/database/driver/mysqli.php on line 209

Warning: mysqli_close(): Couldn't fetch mysqli in /home/***/libraries/joomla/database/driver/mysqli.php on line 216

Warning: mysqli::stat(): Couldn't fetch mysqli in /home/***/libraries/joomla/database/driver/mysqli.php on line 209

Warning: mysqli_close(): Couldn't fetch mysqli in /home/***/libraries/joomla/database/driver/mysqli.php on line 216

Warning: mysqli::stat(): Couldn't fetch mysqli in /home/***/libraries/joomla/database/driver/mysqli.php on line 209

Warning: mysqli_close(): Couldn't fetch mysqli in /home/***/libraries/joomla/database/driver/mysqli.php on line 216
  • After clearing the cache and turning it back on does the error happen the very first time you load the page? Or only on subsequent page loads? You said it happens only on certain pages, can you expand on that? Such as only article Pages or only certain components or with certain modules showing or plugins? – Drew G Oct 15 '17 at 23:30
  • What are you using for caching? Joomla's built in caching system, or a 3rd party extension? – Lodder Oct 16 '17 at 8:09
  • After clearing cache it is fine for a period then returns. It only happens on a page that is essentially a a K2 content list page. It just returns all items from a certain category. I am using Joomlas caching because that is default and im not sure what impact it has to turn it off? – j00m Oct 16 '17 at 13:52
  • If it's only happening on K2 powered pages then it sounds like that's the culprit. Make sure all of the K2 extensions you have installed are up-to-date. If they are (or updating them doesn't fix the issue) then you may might want to ask on their forum ( joomlaworks.net/forum/k2-en ). I believe K2 installs plugins (at least, its own plugin group). You might try disabling all of those plugins. If the issue goes away then re-enable each plugin one by one until the issue comes back. That'll pinpoint which plugin is causing the warnings to fire. – Drew G Oct 16 '17 at 15:48
0

First of all, try disabling error reporting in your configuration settings (setting it to "none" instead of "default" or "maximum") will hide all the errors/warnings/notices. In fact, error reporting should be set to "none" on all production sites, for security reasons and to maintain a professional look.

Now, this error happens when you try to close the connection after the connection has already been closed. Since the problem happens when caching is enabled, then try switching the order of the plugins, where the K2 system plugin is before the System - Page Cache plugin. This might fix the problem.

If the problem is happening when you are not using the Cache plugin (check the Conservative Caching), then try updating the K2 extension and see if that fixes the problem. If it doesn't, or if you already using the latest version (currently 2.8.0) then try reporting the problem to the K2 team. They may have something to say about it.

In my opinion, the problem is a core Joomla problem, where the function disconnect doesn't really check if the connection is open before closing it.

Having said all the above, consider disabling caching if you don't have a large website. Quite often, the disadvantages of Joomla caching far outweigh its advantages.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.