Error
The website encountered an unexpected error. Please try again later.
This is the message that may appear quite often during migration/reconfiguration procedure. It is too generic to get useful information about what is going wrong. To get more details, change the line of code in
<drupal_root>/includes/errors.inc
find the line print this message:
print theme('maintenance_page', array('content' => t("The website encountered an unexpected error. Please try again later.")));
and change into:
print theme('maintenance_page', array('content' => t("The website encountered an unexpected error:<br> !message<br> Please try again later.", $error)));
Then much more details will show up to help locating the source of error.
Registry rebuild
The error is very possible caused by module updates which may cause version conflicts between drupal core or PHP/Database environments. Rebuild registry can help keep consistence in API level to fix the site errors.
To rebuild registry, a drupal module called "registry_rebuild" needs to be installed.
Create 'registry_rebuild' directory under
<drupal_root>/sites/all/modules
and download the module
wget https://ftp.drupal.org/files/projects/registry_rebuild-7.x-2.5.tar.gz
decompress and copy registry_rebuild.php to the module directory. Run
php registry_rebuild.php
Drush
Though Drush never works, still document here for future reference.
install drush tool first. Drush 8.x is the latest version that can work with Drupal 7.
Follow the instructions to install Drush.
Run Drush from <Drupal_root>.
Cache clear
Trying clear cache using Drush:
Drush cc all
never succeeds.
To do that manually one have to deal with the database table directly by
truncate all 'cache_ ' tables.