Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to undefined function cache_get() in includes/module.inc #2262

Closed
sam452 opened this issue Jul 8, 2016 · 6 comments
Closed

Call to undefined function cache_get() in includes/module.inc #2262

sam452 opened this issue Jul 8, 2016 · 6 comments

Comments

@sam452
Copy link

sam452 commented Jul 8, 2016

On a debian 8 install with drupal 7, php 5.6.x I followed these instructions to use drush 8.1.2.

https://www.linode.com/docs/websites/cms/drush-drupal

I attempted to dl and en the memory_profiler
drush dl memory_profiler -y && drush en memory_profiler -y

And a stacktrace indicates Call to undefined function cache_get() in includes/module.inc

I checked google and this string. There appears to be something related that was fixed earlier this year so i probably have missed something up.

This is the result of drush --debug
Using the Drush script found at /usr/local/src/drush/drush.launcher using pcntl_exec
Cache HIT cid: 8.1.2-commandfiles-0-754b9123fafca1e9f1028ecceb8064d3 [debug]
[0.01 sec, 2.34 MB]
Bootstrap to phase 0. [0.17 sec, 5.53 MB] [bootstrap]
Trying to bootstrap as far as we can. [0.18 sec, 5.53 MB] [debug]
Drush bootstrap phase : bootstrap_drupal_root() [0.18 sec, 5.87 MB] [bootstrap]
Initialized Drupal 7.43 root directory at [bootstrap]
/home/myuser/example.org [0.18 sec, 5.87 MB]
Find command files for phase 1 (max=7) [0.18 sec, 4.76 MB] [debug]
Cache HIT cid: 8.1.2-commandfiles-1-a31511f7cd486d27ea263faa7e8234b4 [debug]
[0.18 sec, 4.76 MB]
Drush bootstrap phase : bootstrap_drupal_site() [0.21 sec, 4.77 MB] [bootstrap]
Initialized Drupal site default at sites/default [0.21 sec, 4.77 MB] [bootstrap]
Find command files for phase 2 (max=7) [0.21 sec, 4.77 MB] [debug]
Drush bootstrap phase : bootstrap_drupal_configuration() [0.21 sec, [bootstrap]
4.77 MB]
Find command files for phase 3 (max=7) [0.21 sec, 4.78 MB] [debug]
PHP Fatal error: Uncaught Error: Call to undefined function cache_get() in /home/myuser/example.org/includes/module.inc:750
Stack trace:
#0 /home/myuser/example.org/includes/module.inc(948): module_implements('system_theme_in...')
#1 /home/myuser/example.org/modules/system/system.module(2511): module_invoke_all('system_theme_in...')
#2 /home/myuser/example.org/includes/theme.inc(798): _system_rebuild_theme_data()
#3 /home/myuser/example.org/includes/theme.maintenance.inc(57): list_themes()
#4 /home/myuser/example.org/includes/bootstrap.inc(2600): _drupal_maintenance_theme()
#5 /home/myuser/example.org/includes/errors.inc(179): drupal_maintenance_theme()
#6 /home/myuser/example.org/includes/bootstrap.inc(2337): _drupal_log_error(Array, true)
#7 [internal function]: _drupal_exception_handler(Object(Error))
#8 {main}

thrown in /home/myuser/example.org/includes/module.inc on line 750
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Uncaught Error: Call to undefined function cache_get() in
/home/myuser/example.org/includes/module.inc:750
Stack trace:
#0

/home/myuser/example.org/includes/module.inc(948):
module_implements('system_theme_in...')
#1

/home/myuser/example.org/modules/system/system.module(2511):
module_invoke_all('system_theme_in...')
#2

/home/myuser/example.org/includes/theme.inc(798):
_system_rebuild_theme_data()
#3

/home/myuser/example.org/includes/theme.maintenance.inc(57):
list_themes()
#4

/home/myuser/example.org/includes/bootstrap.inc(2600):
_drupal_maintenance_theme()
#5

/home/myuser/example.org/includes/errors.inc(179):
drupal_maintenance_theme()
#6

/home/myuser/example.org/includes/bootstrap.inc(2337):
_drupal_log_error(Array, true)
#7 [internal function]: _drupal_exception_handler(Object(Error))
#8 {main}

thrown in
/home/myuser/example.org/includes/module.inc, line
750 [0.3 sec, 7.4 MB]

@weitzman
Copy link
Member

Not likely a drush issue.

@greggles
Copy link
Contributor

For what it's worth, I ran into this issue when settings.php had a typo in it and php couldn't parse it.

Some good next steps in general when drush fails this hard:

  • Use the --debug option of drush to see further where it's failing
  • Find and read your php error log

@kenorb
Copy link
Contributor

kenorb commented Dec 1, 2017

@Oli-Chowdhury
Copy link

You can also run this command to do a quick syntax test.

In sites/default run this:

find . -name "*.php" -exec php -l {} ;

@dustinsilva
Copy link

Should be find . -name "*.php" -exec php -l {} \;

@Namone
Copy link

Namone commented Dec 7, 2021

If anyone else hits this, I have found when trying to use Composer in a Drupal 7 project that you need to make sure you're running the correct PHP version (7.1+).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants