1

I have been trying to get the command menu_rebuild(); to work on drush. However, I keep getting this error:

Screenshot of Terminal Window - PHP Fatal error: Call to undefined function: menu_rebuild() in .composer/drush.inc

I, of course, think I installed Drush correctly. However, I can't be 100% certain since I've never used Drush before.

The reason why I am trying to run this command is because my admin menu is giving me problems. Whenever I install new modules, the settings pages corresponding to those modules are missing. Yet, they are installed and working according to Drupal.

1
  • Just to be sure, you have tried drush cc all first right? You may also want to see if this helps.
    – sareed
    Commented Sep 25, 2015 at 21:00

2 Answers 2

3

Make sure you're running drush in your web root and drush status is showing Drupal bootstrap: Successful.

Then try the following steps:

  • drush cc all to clear the caches or clear cache tables manually, e.g.:

    echo "SHOW TABLES LIKE 'cache%'" | $(drush sql-connect) | tail -n +2 | xargs -L1 -I% echo "DELETE FROM %;" | $(drush sql-connect) -v
    
  • try rebuild menu again: drush eval 'menu_rebuild();'

  • try rebuild your Drupal registry via:

    drush -y dl registry_rebuild
    drush rr
    
  • consider disabling caches

In case your drush status doesn't show Drupal bootstrap as Successful, you either running it outside of your Drupal webroot or your db credentials are not configured properly in settings.php, or you've some missing/corrupted files which prevents from bootstrapping your Drupal core.

If you're using multisite, then don't forget to specify your profile by either running inside sites/X dir or make sure you're specifying the right --uri parameter, e.g.: drush -l http://myprofile status (see: drush topic core-global-options for proper syntax).

If you still having the issue, try: drush -vd status to troubleshoot the source of your problem.

1
  • Well, when I run drush status "Drupal bootstrap: successful" doesn't come out. So is this where my error is? I tried drush cc all either way and still gave me the same error. Commented Sep 25, 2015 at 23:23
0

Turns out that the Backup and Migrate module we had installed was causing the issue. Why? I'm not entirely sure but the problem is gone now that we removed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.