Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In Drupal 7 there was a system table which had various fields for the modules found by the system. There was a status column where one could edit and set to 0 to disable a module manually.
I am just beginning to test Drupal 8 and have had a module I just installed have and error. I can't go back to the module page to disable the module.
How can I disable a module manually in Drupal 8??
Comments
Comment #1
swentel CreditAttribution: swentel commentedThat's now in a configuration file - see sites/default/files/config_xxxxxxx/active/system.module.yml - you'll have to clear the cache_bootstrap file after that as well.
Comment #3
mahtab_alam CreditAttribution: mahtab_alam commentedyou can disable the module from drush commands
drush pm-uninstall module_name
Comment #4
soumyapsadanandan CreditAttribution: soumyapsadanandan as a volunteer commentedThis is how, I manually removed a module named "better_messages" from my Drupal 8 instance. As soon as I installed the "better_messages" module, the site went down. So I was unable to uninstall the module through UI.
If rebuild.php or update.php is not working add the line to settings.php
$settings['rebuild_access'] = TRUE;
DELETE FROM key_value WHERE collection='system.schema' AND name='better_messages';
In my case, there was no entry in the database.Comment #5
prakash.d CreditAttribution: prakash.d as a volunteer commentedThanks.
i did using these steps
1)Manually delete module from module folder.
2)delete that module from key_value table
3)clear catches through UI.
Done.
Comment #6
alarhby CreditAttribution: alarhby commentedDear soumyapsadanandan
thank you so much for your support , your way saved my site.
thank you.
Comment #7
vishalkhapre CreditAttribution: vishalkhapre as a volunteer commentedActually, these steps by Soumya helped, and site was back. That started another issue where it started giving error when I tried to install other modules. I tried several different combinations the procedures above with and without module on filesystem.
Drupal\Core\Extension\Exception\UnknownExtensionException: The module XXXX does not exist. in Drupal\Core\Extension\ExtensionList->getPathname() (line 522 of /home/customer/www/new.dfwmm.org/public_html/core/lib/Drupal/Core/Extension/ExtensionList.php).
Here is what solution for this.
1) Select the row from database as below
SELECT * FROM `config` WHERE name like '%core.extension%' ORDER BY `name` ASC
2) download the 'data' column into a file, it is serialized data.
3) Use the website https://serializededitor.com/ to deserialize the serialized object. You can do all on the website
4) On website, remove the particular module node.
5) Save the object to a file
6) Update the column 'data' in that row, you can delete the row and add new one. However you prefer.
Then rebuild the site using the https://site/core/rebuild.php, add $settings['rebuild_access'] = TRUE; to settings if that does not work.
That removed the pending entry from system about the module.
You can also write a php program to deserialize, and serialize back if you want. The site just made it easier.
Cheers!!