rtfulk:
I have just upgraded from 1.5.1 to 1.5.3. Everything went well I thought, but after the database upgrade I am getting blanks pages on my website and admin page. I checked the logs and this is what I'm getting.
PHP Fatal error: Cannot redeclare class QueryCache in /home/xxxxxx/public_html/includes/classes/query_cache.php on line 16
I think the database upgrade aspect may be a bit of a red herring. The PHP error is related to the files, not the database.
rtfulk:
When I check line 16 of query_cache.php this is whats on it.
class QueryCache {
This is what I would be expecting to find here (based on the error message).
rtfulk:
I thought I would try to upgrade the database again, but when I run zc_install all I get now is install button no upgrade. My site is www.countryhomemade.com
Step away from the database for the time being.
What the error message is telling us is "Line #16 of query_cache.php needs to create a 'class' called 'QueryCache' but I can't do this because a class of this name has already been created".
In other words, the message itself isn't particularly helpful because it doesn't tell us where the 'class' was previously declared, so that's really the 1st thing you need to find out.
There aren't many possible causes of classes to be redeclared, and probably the most common cause is because a backup file declaring the same class exists in the same folder as the original file. There are other reasons, but the bottom line is, you have somehow got two different files that both contain a line that reads
"class QueryCache {"
So, the easiest way to tackle this problem is to use the ZenCart Developers Toolkit and perform a case sensitive search on all the .php files for "QueryCache".
On a 'good' system (V1.5.3) there will be a total of four matches, in two different files.
**/includes/auto_loaders/config.core.php
**Line #76 : 'className'=>'QueryCache',
and
**/includes/classes/query_cache.php
**Line #13 : * QueryCache
Line #16 : class QueryCache {
Line #18 : function QueryCache() {
If you find any other files that match the 1st thing to do is rename them so they don't have a .php filename extension (especially if they appear to be a backup file). This is all you will probably need to do to take care of the error being reported. If this is the only error on the site you'll probably find it'll just spring back to life. If it doesn't you'll probably find a different error is now being reported.
I would suggest that when you get to this point that you come back here and report on your findings in regards to the possible duplicated/backup file as well as reporting any further error messages. Avoid the temptation to go any further yourself (unless confident with what you are doing), because the last thing we need at this stage is the possibility of compounding the problem.
Cheers
RodG
NOTE: We are sorry that Rod is no longer with us.
We are grateful for all his contributions to the Zen Cart community.
Ozpost - The Ultimate Shipping module for Australian Merchants. Click these links for its Homepage, or Download from Zen-Cart.com.