Does the order in which modules are mentioned in app/etc/config.php matter for Magento 2?

I have looked closely at the code, but could not find any logic to the sorting of the modules. I know the config.php file is auto-generated.

Now assume that we manually edit the file (which you shouldn't do normally), does the order in which the modules are placed matter?

There is also a ticket on Github that relates to this, but I cannot tell what the current situation is with regards to the sequence being important or not:



AKAIK - all the modules namespace are listed in config.php file and there order is not matter at all.

Actually that specific modules value is matter most over here like 0 and 1

when you have value of 1 that means module is enabled

when you have value of 0 that means module is disabled

apart from that - order of the module listing is not matter at all , but while you are editing the file you need to take care that syntax should be a proper otherwise if you put value of first module on the last and value of last module on the first but its value is proper then its not matter at all.


modules listing is depend on app/etc/config.php .

The module which is listed at first at config.phpwill load first.

Yes, if you will edit config.php manually then the loading of the modules will change accordingly


We had a similar issue, where the ordering of modules changing was causing us problems, this is the solution we came up with: https://github.com/zero1limited/magento2-PreserveModuleOrderingInProductionMode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.