Please help

Fatal error: Cannot redeclare class InsertQuery in /home/xxxxx/domains/xxxxxxx.lt/public_html/includes/database/query.inc on line 727

Can't access some administration files

Comments

Beata43’s picture

Front page also don't work
What to do?

and Else
Fatal error: Class 'SelectQuery_mysql' not found in /home/xxxxx/domains/xxxxxx.lt/public_html/includes/database/database.inc on line 794

Di4iMoRtAl’s picture

This is the error I get when updating from Drupal 7.16.to 7.17: Fatal error: Cannot redeclare class InsertQuery in /www/domain/www/root/includes/database/query.inc on line 727. In my local development environment there was no such problem, but when I update the site on my hosting this fatal error came up. The same happens and when I clear all the cashes.
Please if anyone can help it will be great!

William Aubert’s picture

I have the same error

Fatal error: Cannot redeclare class QueryConditionInterface in /home/www/domain/includes/database/query.inc on line 16

maxbanton’s picture

i have same problem

enzo3946’s picture

Does anyone found a solution?

enzo3946’s picture

Do you need change some class definition in query.inc and select.inc on \includes\database

Do you need add this file before class definition:
if (!class_exists('TruncateQuery_mysql')) {

Ex:
if (!class_exists('TruncateQuery_mysql')) {
class TruncateQuery_mysql extends TruncateQuery {
...
}
}

If you have an error with some interface declaration:
if (!interface_exists('TruncateQuery_mysql')) {

Ex:
if (!interface_exists('TruncateQuery_mysql')) {
interface TruncateQuery_mysql extends TruncateQuery {
...
}
}

Greetings!

giri99’s picture

What if the error happens with functions, I got a fatal error :

cannot redeclare array_column() in /sites/modules/xxxx.module on line 30.

It looks like array_column() is already declared. How to overcome this error.

charcotrill’s picture

I had this happen to a site of mine after using drush to update core (don't hit me, I like to live dangerously). Turns out that all of the core Drupal root directories (modules, includes, themes, etc) were copied inside themselves, so I had to go in and remove the duplicates (including an extra sites/xxxxx/settings.php that I have NO IDEA how it got there).

Once I did that, I ran php registry_rebuild.php (see drupal.org/project/registry_rebuild), and that tidied up the rest of the mess. The site's back up and purring along like I never horribly mangled it in the first place!

edit: fixed typo in url

kalabro’s picture

Thanks a lot!

SuperDruper’s picture

Thank you for posting your comment because when John B kindly pointed me to your post, it fixed my white screen of death. I had too had duplicated folders after trying to do a module update. I deleted the duplicates (but still had WSOD) and it was the registry rebuild that fixed everything. Now, after mangling up website, thanks to your post, my site is purring along too! Happy days...

118218’s picture

Thank you enzo3946, it worked for me!

theodorosploumis’s picture

Most times this error is because Drush is installing the new files in wrong places.

If the registry_rebuild module does not work for any reason you have to log into the Database go to the "registry" table and fix manually the wrong Class paths. Eg search for paths like % "includes/includes" since the correct paths should be just "includes".

TheodorosPloumis.com - Drupal developer @ eworx.gr.