Earlier I had spoken about some strange issues which I ran into while using Pligg on one of the social book marking sute – BukMark:
public_html/libs/ ez_sql_core.php error in Pligg and Error establishing mySQL database connection. Correct user/password? Correct hostname? Database server running? in /public_html/libs/db.php on line 87
And now I have one more problem. The site was working fine. As in all modules showing info as expected, but somewhere in between it was kicking out some unwanted values, which had no proper explanation.
The solution for this problem is pretty simple. Try and delete all the pages in the templates_c directory. This should solve the problem.
If the problem still persists, drop in a message here and let us see if there is anything we can do about it.
I recently encountered : Error establishing mySQL database connection. Correct user/password? Correct hostname? Database server running? in /public_html/libs/db.php on line 87 error and now there is another error that was showing up in the small social bookmarking site run by a few friends.
Solution for this one is very simple. Find the ‘Cache’ folder and delete it’s content and you’ll have your pligg site up and running fine.
There may be a bug fix in the latest version of pligg. The developers of pligg had a cron done to delete the corrupt files that were created by the script. But that’s not a perfect solution as this problem might kick in even before the cron kicks in and the site will potentially be down till then. You can essentially schedule the cron to get to work every other minute, but doesn’t really sound neat.
Here’s what you need to do for a better solution :
if ( (time() – filemtime($cache_file)) > ($this->cache_timeout*3600) )
and replace it with :
if ( (time() – filemtime($cache_file)) > ($this->cache_timeout*3600) || (filesize($cache_file) > 2000000) )
This piece of code will simply delete the cache file if it’s close to 2MB and recreate it. thus there will be no more server crases and the cron need not be in picture
We initially set up a cron to delete the corrupt files created by the script – but that’s hardly a solution as the site could go down before the cron kicks in, and be down until it does (we had it checking every 5 mins to be safe…but still…)
So here’s a simple, better solution. Here’s hoping the devs will include it in their next update. I just checked the 9.9.5 release and nope, problem still there. So here’s what you need to do: