I installed a local copy of Magento 2 into my XAMPP and have been getting to know the new structure. I have however run into a problem when trying to setup a basic module.

I have created the following file/folder structure


Inside this file I have the following

<?xml version="1.0"?>
    <module name="Heirik_Test" schema_version="2.0.0">

I refreshed the store cache however when I go to store>configuration>advanced the module is not loading into the list. According to the most recent devdocs there is no longer a need to set the module to active inside the XML.

I know that Magento is reading the module.xml because if I remove the schema_version parameter I get an error.

5 Answers 5


With the latest builds of Magento this has changed to

php -f bin/magento module:enable --clear-static-content Module_Name
php -f bin/magento setup:upgrade
  • Nice update. I marked this as the correct answer as it accurately reflects the current build status.
    – Eirik
    Commented May 5, 2015 at 2:19

After some searching, trial and error I located the following answer

For an existing Magento instance, you'll need to register a custom module as follows:

  1. Edit the app/etc/config.php file and add your module there and specify value "1" (enabled)
  2. Then refresh the cache.

So in my case I had to add

'Heirik_Test' => 1,

Into the Modules array inside app/etc/config.php

  • This is correct, but may be reworked before GA. The config.php file is relatively new. The modules array is in the required load order. The setup process works out the sequencing so at run time it just has to load the modules in the order of the array. So for now, yes, add your module to the array, but if your module must be loaded before another module you need to put it in the right place. We should make it nicer to add a new module without needing to manually editing config.php.
    – Alan Kent
    Commented Dec 28, 2014 at 6:45
  • 2
    I recommend to not edit app/etc/config.php by hand as it is now possible to use php -f setup/index.php module-enable Heirik_Test which will sort the modules based on sequence (plus it's safer than editing manually). Commented Feb 15, 2015 at 23:47
  • @fooman at the time of original writing you were not able to. But now you are able to, but thanks for updating the answer.
    – Eirik
    Commented Feb 16, 2015 at 20:53
  • @Eirik I know - just wanted to make sure that this information gets out there Commented Feb 16, 2015 at 20:57

Or even easier, got to Mage install dir and run:

php -f setup/index.php module-enable --modules=MODULENAME
php -f setup/index.php update

So my issue when trying to get a custom module to register, running Magento 2.2.0 was that the composer generated file vendor/composer/autoload_files.php was not updated when I ran composer update.

It didn't matter what I did, manually adding it to the config.php would make it look like it was working but after running magento setup:upgrade the module was no longer registered and didn't run any install/upgrade scripts.

After updating composer properly and tripple checking it was in the autoload_files, the module registered and I sighed of relief.

Just something to be aware of. Hopefully if anyone else has issues similar, this can shed some light.


Your module's file named module.xml file config tag should have XML schema and its xsd location which validate your module.xml file structure. Schema value should be like

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd"

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.