My Drupal 7 installation works fine, except for drush, which does not.

$ cd /srv/www/drupal_site

$ drush pm-refresh

PHP Fatal error: Call to undefined function user_load() in /usr/share/php/drush/includes/drupal.inc on line 138

Drush command terminated abnormally due to an unrecoverable error.

Error: Call to undefined function user_load() in /usr/share/php/drush/includes/drupal.inc, line 138

Drush was not able to start (bootstrap) Drupal.

This is Drupal 7.24 and drush 5.10.0 from Debian. A couple of modules and themes have been installed from drupal.org but IMHO nothing fancy. Curent versions of drush6 or drush7 refer to a missing drupal_get_profile() function but otherwise don't help.

Any ideas what the cause of this problem is, and/or how to debug this?

EDIT: It works fine, except for these spurious error lines displayed on the web page (even though I do not use any sort of debug mode), as reported by a user:

Notice: Undefined index: post-load integration files in libraries_load_files() (line 697 of /var/www/drupal7/modules/libraries/libraries.module).

This may or may not be related to my problem.

I tried using Drush 6.x/7.x, but it just returns a different error message.

Call to undefined function drupal_get_profile() in /usr/share/php/drush/includes/bootstrap.inc on line 963

drush cc hits an error before it can do anything; the same happens with drush rr, which returns a different error, but equally intractable.

php-apc is not installed; I have Memcached, but killing it didn't change anything.
I did not change any module weights.

  • Are you having multisite environment? Apr 14, 2014 at 6:36
  • While I do have multiple sites, they each have their own drupal subdirectory, symlinked to the Debian-installed Drupal. Apr 14, 2014 at 8:42
  • @MatthiasUrlichs What's the result of: drush status. Do you have Connected and bootstrap says Successful?
    – kenorb
    Mar 8, 2015 at 12:59
  • I just ran into this issue yesterday in a Drupal 7 / Drush 5 environment. Posting here in case anybody else runs into this. My database import had failed because it had MySQL views without a proper creator on the instance where it was imported. The odd thing was that 95% of the other structure was there, but it was missing a few tables. Clear up your db import and then it should be able to fully bootstrap. Feb 4, 2020 at 14:08

1 Answer 1


We got the same errors here.

After some time we recognized that our database-import (cloning production db to local dev machine) went wrong and the database wasn't populated properly. After fixing the db the errors went away...

So - my hint: check your database structure and data.

BTW: There is a similar question - but with an memcached in the drupal setup

  • Hmm, "check your database structure and data" is rather open-ended. I did not manually manipulate any database settings or contents and did not deinstall any modules or whatever. The site itself works. Feb 24, 2014 at 14:23
  • In our case the site itself didn't work either - also showing some "function not found" error in the browser. And by checking I meant to look in the database for obvious problems, like tables without any data or tables missing (compared to the source/production database).
    – gue
    Feb 24, 2014 at 15:40

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