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

Drush on Ubuntu 16.04 with php5.6 installed fails with Call to undefined function cache_get() #2848

Closed
robbrandt opened this issue Jul 19, 2017 · 3 comments

Comments

@robbrandt
Copy link

I have a relatively new Ubuntu 16.04 server running on Amazon. The server does not allow root login. A minimal Drupal 7 site is installed, as well as Drush 8. I installed Drush 8 by following these steps for global access:

http://docs.drush.org/en/8.x/install/

core-status shows:
php5.6 drush.phar core-status
PHP configuration : /etc/php/5.6/cli/php.ini
PHP OS : Linux
Drush script : /home/ubuntu/drush.phar
Drush version : 8.1.12
Drush temp directory : /tmp
Drush configuration :
Drush alias files :

when logged in as the user account, running a drupal upgrade gets:
PHP Fatal error: Uncaught Error: Call to undefined function cache_get() in /home/crm/public_html/includes/module.inc:754
Stack trace:
#0 /home/crm/public_html/includes/module.inc(954): module_implements('system_theme_in...')
#1 /home/crm/public_html/modules/system/system.module(2511): module_invoke_all('system_theme_in...')
#2 /home/crm/public_html/includes/theme.inc(798): _system_rebuild_theme_data()
#3 /home/crm/public_html/includes/theme.maintenance.inc(57): list_themes()
#4 /home/crm/public_html/includes/bootstrap.inc(2867): _drupal_maintenance_theme()
#5 /home/crm/public_html/includes/errors.inc(179): drupal_maintenance_theme()
#6 /home/crm/public_html/includes/bootstrap.inc(2604): _drupal_log_error(Array, true)
#7 [internal function]: _drupal_exception_handler(Object(Error))
#8 {main}
thrown in /home/crm/public_html/includes/module.inc on line 754
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Uncaught Error: Call to undefined function cache_get() in
/home/crm/public_html/includes/module.inc:754
Stack trace:
#0 /home/crm/public_html/includes/module.inc(954):
module_implements('system_theme_in...')
#1 /home/crm/public_html/modules/system/system.module(2511):
module_invoke_all('system_theme_in...')
#2 /home/crm/public_html/includes/theme.inc(798):
_system_rebuild_theme_data()
#3 /home/crm/public_html/includes/theme.maintenance.inc(57):
list_themes()
#4 /home/crm/public_html/includes/bootstrap.inc(2867):
_drupal_maintenance_theme()
#5 /home/crm/public_html/includes/errors.inc(179):
drupal_maintenance_theme()
#6 /home/crm/public_html/includes/bootstrap.inc(2604):
_drupal_log_error(Array, true)
#7 [internal function]: _drupal_exception_handler(Object(Error))
#8 {main}
thrown in /home/crm/public_html/includes/module.inc, line 754

This seems to be an error related to using php7 instead of 5.6. I specified 5.6 in the installation.

How do I resolve this?

@robbrandt
Copy link
Author

I sudo'd into root, just to see if it's a permission problem. Running as root produces the same error.

@robbrandt
Copy link
Author

I did do a backtrace before the get_cache function, and it revealed the issue is "Undefined class constant 'MYSQL_ATTR_SSL_CA'" (full backtrace listed below).

Lots of helpful hints here, but I don't have any of these problems. All Mysql libraries loaded and working.
https://stackoverflow.com/questions/39740933/php-fatal-error-undefined-class-content-drush

#0 module_implements(system_theme_info) called at [/home/crm/domains/testing.crm.botany.org/public_html/includes/module.inc:957]
#1 module_invoke_all(system_theme_info) called at [/home/crm/domains/testing.crm.botany.org/public_html/modules/system/system.module:2511]
#2 _system_rebuild_theme_data() called at [/home/crm/domains/testing.crm.botany.org/public_html/includes/theme.inc:798]
#3 list_themes() called at [/home/crm/domains/testing.crm.botany.org/public_html/includes/theme.maintenance.inc:57]
#4 _drupal_maintenance_theme() called at [/home/crm/domains/testing.crm.botany.org/public_html/includes/bootstrap.inc:2867]
#5 drupal_maintenance_theme() called at [/home/crm/domains/testing.crm.botany.org/public_html/includes/errors.inc:179]
#6 _drupal_log_error(Array ([%type] => Error,[!message] => Undefined class constant 'MYSQL_ATTR_SSL_CA',[%function] => Drush\Sql\Sqlmysql->creds(),[%file] => phar:///usr/bin/drush/lib/Drush/Sql/Sqlmysql.php,[%line] => 56,[severity_level] => 3), 1) called at [/home/crm/domains/testing.crm.botany.org/public_html/includes/bootstrap.inc:2604]
#7 _drupal_exception_handler(Error Object ([*message] => Undefined class constant 'MYSQL_ATTR_SSL_CA',[Errorstring] => ,[*code] => 0,[*file] => phar:///usr/bin/drush/lib/Drush/Sql/Sqlmysql.php,[*line] => 56,[Errortrace] => Array ([0] => Array ([file] => phar:///usr/bin/drush/lib/Drush/Sql/SqlBase.php,[line] => 164,[function] => creds,[class] => Drush\Sql\Sqlmysql,[type] => ->,[args] => Array ()),[1] => Array ([file] => phar:///usr/bin/drush/includes/environment.inc,[line] => 393,[function] => query,[class] => Drush\Sql\SqlBase,[type] => ->,[args] => Array ([0] => SELECT 1;)),[2] => Array ([file] => phar:///usr/bin/drush/lib/Drush/Boot/DrupalBoot.php,[line] => 462,[function] => drush_valid_db_credentials,[args] => Array ()),[3] => Array ([file] => phar:///usr/bin/drush/lib/Drush/Boot/DrupalBoot7.php,[line] => 70,[function] => bootstrap_drupal_database_validate,[class] => Drush\Boot\DrupalBoot,[type] => ->,[args] => Array ()),[4] => Array ([file] => phar:///usr/bin/drush/includes/bootstrap.inc,[line] => 430,[function] => bootstrap_drupal_database_validate,[class] => Drush\Boot\DrupalBoot7,[type] => ->,[args] => Array ()),[5] => Array ([file] => phar:///usr/bin/drush/includes/bootstrap.inc,[line] => 471,[function] => drush_bootstrap_validate,[args] => Array ([0] => 4)),[6] => Array ([file] => phar:///usr/bin/drush/lib/Drush/Boot/BaseBoot.php,[line] => 59,[function] => drush_bootstrap_to_phase,[args] => Array ([0] => 6)),[7] => Array ([file] => phar:///usr/bin/drush/includes/preflight.inc,[line] => 66,[function] => bootstrap_and_dispatch,[class] => Drush\Boot\BaseBoot,[type] => ->,[args] => Array ()),[8] => Array ([file] => phar:///usr/bin/drush/includes/startup.inc,[line] => 458,[function] => drush_main,[args] => Array ()),[9] => Array ([file] => phar:///usr/bin/drush/includes/startup.inc,[line] => 365,[function] => drush_run_main,[args] => Array ([0] => ,[1] => /,[2] => Phar detected. Proceeding to drush_main().)),[10] => Array ([file] => phar:///usr/bin/drush/drush,[line] => 114,[function] => drush_startup,[args] => Array ([0] => Array ([0] => /usr/bin/drush,[1] => pm-update,[2] => drupal))),[11] => Array ([file] => /usr/bin/drush,[line] => 10,[args] => Array ([0] => phar:///usr/bin/drush/drush),[function] => require)),[Errorprevious] => ))

@weitzman
Copy link
Member

Not a drush issue

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

2 participants