2

Use case: I enabled a module, without enabling the required module. I saved the configuration on the modules page and it showed me the following screen - enter image description here

I clicked "Continue" and then I get the WSOD (blank page).

I added error reporting php code in my index.php in root directory. It showed a fatal error - Fatal error: Call to undefined function variable_realm_switch() in /mysite/sites/all/modules/i18n/i18n_variable/i18n_variable.module on line 54

I cannot go back to the admin pages to enable the required module, because of WSOD. Is there a way to enable the module from the code? I cannot delete the modules involved in this error, because I will end up losing the data associated with the modules.

1 Answer 1

7

Using phpMyAdmin or any other database management software (or via command line mysql if you are comfortable with that), find the name of the module you wish to enable or disable in the system table. Set the status for that module to 0 for disabled or 1 for enabled.

mysql command:

UPDATE  `database_name`.`system` SET  `status` =  '1' WHERE  `system`.`name` =  'module_name';

phpMyAdmin screenshot:

Drupal system table in phpMyAdmin with status column highlighted

I also recommend installing Drush on your server. This will allow you to execute commands like enabling/disabling modules, clearing caches, etc. from the command line, which is very handy in situations where you cannot access the Drupal admin because of a WSOD.

4
  • 1
    +1 for Drush, best thing that I learned to install and use, a real time saver, and just overall awesome for updating drupal and modules, running quick php scripts with drupal bootloader etc... Get it!
    – Beebee
    Commented May 5, 2012 at 1:26
  • I didn't come from a programming background when I started using Drupal and I was super reluctant to try out Drush. I've been using it for 2 years now and couldn't imagine working without it. It's well worth the hassle (for non-programmer types) of setting it up and learning it.
    – sheena_d
    Commented May 5, 2012 at 3:25
  • Thanks for the recommendation. I was very hopeful that your solution would work. However, I still see the fatal error. I disabled all modules through command line, just in case. Do I need to do anything else? like clearing cache. I normally never have to clear cache to make the newly enabled/ disabled module take effect. Commented May 8, 2012 at 2:47
  • Clearing caches is always the first step to troubleshooting an issue, even if it doesn't seem like it should matter. Are you still getting the same PHP error?
    – sheena_d
    Commented May 8, 2012 at 14:02

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.