0

This question already has an answer here:

I'm running Drupal 7.67 on a Debian machine with PHP 7.2 and MySQL 5.6. My drupal installation is working perfectly fine with no warnings to find under /admin/reports/status.

I've installed Drush 9.x globally with Composer.

When I run "drush status --debug" in the web directory of my Drupal installation, I receive this error message:

myUser@myMachine:~/myWebDirectory$ drush status --debug
Using the Drush script found at /is/htdocs/myUser/bin/drush-master/drush.launcher using proc_open
 [bootstrap] drush_preflight_prepare() loaded autoloader at /is/htdocs/myUser/bin/drush-master/vendor/autoload.php [0 sec, 5 MB]
 [bootstrap] Starting Drush preflight. [0 sec, 5.01 MB]
 [debug] Cache HIT cid: 9.0-dev-dev-commandfiles-0-539b07fd30cf8fc46a105d61403b7bda [0.01 sec, 5.01 MB]
 [warning] get_class() expects parameter 1 to be object, null given AnnotatedCommandFactory.php:187 [0.06 sec, 8.26 MB]
 [bootstrap] Dispatching using Drush bootstrap_and_dispatch [0.06 sec, 8.74 MB]
 [bootstrap] Bootstrap to phase 0. [0.06 sec, 8.81 MB]
 [debug] Trying to bootstrap as far as we can. [0.06 sec, 8.81 MB]
 [bootstrap] Drush bootstrap phase : bootstrap_drupal_root() [0.07 sec, 9.1 MB]
 [bootstrap] Initialized Drupal 7.67 root directory at /is/htdocs/myUser/myWebDirectory [0.07 sec, 9.1 MB]
 [debug] Find command files for phase 1 (max=6) [0.07 sec, 8.86 MB]
 [debug] Cache HIT cid: 9.0-dev-dev-commandfiles-1-11909118d8d7d3502a7e4626fef13841 [0.07 sec, 8.86 MB]
 [debug] Cache HIT cid: 9.0-dev-dev-annotationfiles-1-f2ecc8930fc6773d5283329e81e11332 [0.07 sec, 8.86 MB]
 [bootstrap] Drush bootstrap phase : bootstrap_drupal_site() [0.07 sec, 8.87 MB]
 [bootstrap] Initialized Drupal site default at sites/default [0.07 sec, 8.87 MB]
 [debug] Find command files for phase 2 (max=6) [0.07 sec, 8.88 MB]
 [bootstrap] Drush bootstrap phase : bootstrap_drupal_configuration() [0.07 sec, 8.88 MB]
 [info] Undefined variable: override DrupalBoot.php:468 [0.08 sec, 9.16 MB]
 [warning] array_merge(): Argument #2 is not an array DrupalBoot.php:468 [0.08 sec, 9.16 MB]
 [debug] Find command files for phase 3 (max=6) [0.08 sec, 9.16 MB]

Fatal error: Uncaught Error: Call to undefined function cache_get() in /is/htdocs/myUser/myWebDirectory/includes/module.inc:762
Stack trace:
#0 /is/htdocs/myUser/myWebDirectory/includes/module.inc(962): module_implements('system_theme_in...')
#1 /is/htdocs/myUser/myWebDirectory/modules/system/system.module(2514): module_invoke_all('system_theme_in...')
#2 /is/htdocs/myUser/myWebDirectory/includes/theme.inc(798): _system_rebuild_theme_data()
#3 /is/htdocs/myUser/myWebDirectory/includes/theme.maintenance.inc(57): list_themes()
#4 /is/htdocs/myUser/myWebDirectory/includes/bootstrap.inc(2894): _drupal_maintenance_theme()
#5 /is/htdocs/myUser/myWebDirectory/includes/errors.inc(179): drupal_maintenance_theme()
#6 /is/htdocs/myUser/myWebDirectory/includes/bootstrap.inc(2622): _drupal_log_error(Array, true)
#7 [internal function]: _drupal_exception_handler(Object(Error))
#8 {main}
  thrown in /is/htdocs/myUser/myWebDirectory/includes/module.inc on line 762
 [error]  Drush command terminated abnormally due to an unrecoverable error.
Error: Uncaught Error: Call to undefined function cache_get() in /is/htdocs/myUser/myWebDirectory/includes/module.inc:762
Stack trace:
#0 /is/htdocs/myUser/myWebDirectory/includes/module.inc(962): module_implements('system_theme_in...')
#1 /is/htdocs/myUser/myWebDirectory/modules/system/system.module(2514): module_invoke_all('system_theme_in...')
#2 /is/htdocs/myUser/myWebDirectory/includes/theme.inc(798): _system_rebuild_theme_data()
#3 /is/htdocs/myUser/myWebDirectory/includes/theme.maintenance.inc(57): list_themes()
#4 /is/htdocs/myUser/myWebDirectory/includes/bootstrap.inc(2894): _drupal_maintenance_theme()
#5 /is/htdocs/myUser/myWebDirectory/includes/errors.inc(179): drupal_maintenance_theme()
#6 /is/htdocs/myUser/myWebDirectory/includes/bootstrap.inc(2622): _drupal_log_error(Array, true)
#7 [internal function]: _drupal_exception_handler(Object(Error))
#8 {main}
  thrown in /is/htdocs/myUser/myWebDirectory/includes/module.inc, line 762 [0.1 sec, 11.79 MB]
 [info] A non well formed numeric value encountered drush.inc:1438 [0.1 sec, 11.8 MB]

I've dug through the drupal forums and found this thread, which seems to describe my issue pretty well: https://www.drupal.org/forum/support/post-installation/2016-06-23/fatal-error-call-to-undefined-function-cache_get

Unfortunately none of the presented solutions seem to work in my case. I've checked the settings-file for errors, using "php -l". I even switched the settings-file with a brand new one where I manually entered all the data needed to run the site, but to no effect.

I checked for old settings like

ini_set('session.save_handler', 'user');

but my settings.php file is up to date and free of errors.

I set the PHP version used in my web directory from 7.2 back to 7.1 but the same error still exists.

Now I've run out of ideas. I need drush to update the metatag module of my installation, since it runs into a timeout when I start the update in the web interface. I hope the timeout will not happen when I start the update via drush.

Any help is highly appreciated.

marked as duplicate by 4k4, Clive Aug 12 at 9:50

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You've said "I've installed Drush 9.x globally with Composer." There are two issues in this statement. 1. You can't use Drush 9. See the duplicate and it was marked correctly because this is how the question title starts. 2. Your install method is outdated. The preferred method is downloading a phar file, see the official install documentation docs.drush.org/en/8.x/install – 4k4 Aug 12 at 11:29

Browse other questions tagged or ask your own question.