I have a running Drupal 7 site and wanted to restore it locally on development computer. But on localhost I keep receiving white screen in Firefox or Internal Server Error code 500 on Chrome.

Debugging shows that Drupal is running line 1895 of bootstrap.inc, which says:

$denied = (bool)db_query("SELECT 1 FROM {blocked_ips} WHERE ip = :ip", array(':ip' => $ip))->fetchField();

And just after this line it jumps to error handler, complaining about missing blocked_ips table. The blocked_ips table is not there on either site, the production site had no problem with it.

How to deal with this?


The blocked_ips table is created unconditionally by the system module...it should be there in any standard D7 install.

The process goes like this:

So Drupal is expecting that table to exist. The only caveat is that if you have a variable called blocked_ips in the variable table the value from there will be used instead of the database being queried. Maybe you have that variable on the local version, and not on the live, and the issue is being masked by that fact?

If you didn't have any data in that table then it would be safe to copy the schema from an empty Drupal install and just create the table.

However, it might be worth checking the integrity of the rest of your data as it sounds like something's gone wrong either on your local copy or during the migration.

  • You're right, the table must be there in D7 install. The problem was, that I logged to D6 database in phpmyadmin with almost identical name and exported from there into local D7.. sorry for the mess.
    – camcam
    Nov 12 '12 at 19:34

Your local development DB has been damaged. Luckily, this is not your production site. Just download your production database and import it into your development site.

To backup your dtabse you can use several tools: form phpMyAdmin to "drush sql-dump" drush command or the handy module Backup and Migrate. To import you the same tools (but use "drush sql-cli" and pipe the DB content if you use drush, instead of sql-dump, for obvious reasons).


In your settings.php file you have a blocked_ip index in the $conf array. If you uncomment this you bypass the 'blocked_ip' table query. It's possible that the production site has this change but not your local.

E.g. production settings.php (around line 440):

$conf['blocked_ips'] = array(

The array could also contain a list of IP's.

Your local settings.php:

# $conf['blocked_ips'] = array(
#   'a.b.c.d',
# );

I have also encountered such kind of situation when cloning my site into my local development server. When I downloaded sql dump files for each module by module and imported them into my localhost, it did work for me.

Firstly, about white screen, check this answer. Then, Drupal will display errors on the screen.

Then, download sql dump files for each module by module, for example, the block module has 4 modules - block, block_custom, block_node_type, block_role. Export those 4 tables in a sql file and same for other modules. Most likely, tables in the same module have same prefix. Import them all into your localhost each by each including the system and variables tables.

Note that the cache tables should be exported and imported by structure only.

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.