A machine-readable guide to this site for AI agents and language models is available at/llms.txt(https://dev.acquia.com/llms.txt on the production site).
How to rebuild the Drupal 7 registry | Cloud Platform | Acquia Product Documentation
Cloud Platform
How to rebuild the Drupal 7 registry
How to rebuild the Drupal 7 registry
Date Published: January 6, 2023
Note
Although rebuilding an existing registry to incorporate new changes is not that expensive (because the registry will not re-parse files that have the same path and modification time as the last build), some of these instructions can have performance implications. Acquia recommends that you perform any cache clearing or registry rebuilds with care. Acquia also highly recommends that you perform a database backup before proceeding.
Drupal 7 registry issues can look like cache problems. If you're not sure that you've cleared all the caches, you can try the different options for clearing cache as suggested by Chris Shattuck's cache clearing instructions page.
The easiest way to ensure that you've cleared all Drupal caches is to use the following Drush command (which is an abbreviated form of drush cache-clear all):
drush cc all
If, after clearing the cache, you still encounter errors similar to the following, you might need to rebuild the registry:
PHP Fatal error: Class 'EntityAPIControllerExportable' not found in ...sites/all/modules/rules/includes/rules.core.inc on line 11
Rebuilding the registry
The best way to rebuild your registry is to use Drush from the command line. Run the following command in either the sites/default or sites/all/[sitename] folder for a site:
drush php-eval "registry_rebuild();"
If Drush is not working properly, you can also try:
For information about registry_rebuild (a bootstrap function that can help you rebuild your registry), see the function registry_rebuild API documentation.
You can also rebuild your Drupal registry by using the Registry Rebuild script and procedure found on Drupal.org.
Important
If this script is installed in the /sites/all/modules directory, anonymous users can access it and run a registry rebuild.