Drupal - What could be causing drupal to want to reinstall itself after I clear cache?

That occurs because Drupal can't connect to its database

Ensure you have:

  • settings.php

in your Drupal /sites/default folder.

settings.php must be readable by the webserver user and contain valid database connection string credentials for that server. Make sure the base_url is either default commented out or valid for that domain.

See _drupal_bootstrap_database for the place where the install.php redirect occurs.

Also, make sure you've run update.php and do clear all caches if possible.


Just to add, after my site (D7.23 on Ubuntu 12.04.3) randomly decided it needed to be installed again, I found out that an archive process had changed the permissions on the sites/default directory to 755.

At first I didn't think it was this because the change in permissions was less restrictive i.e. giving user and group more permissions; but I guess there is a security check somewhere in Drupal that will only accept the sites/default if it has the permissions 555 — the thinking being that the folder may have been tampered with. The same also seems to be true for settings.php in that my install requires it to be 444, if not, I get the install UI.

Tags:

7

Installing