In addition to the command arguments described in this topic, see Common arguments.
Run all Magento CLI commands as the Magento file system owner.
Code compilation includes the following (in no particular order):
- Application code generation (factories, proxies)
- Area configuration aggregation (optimized dependency injection configurations per area)
- Interceptor generation (optimized code generation of interceptors)
- Interception cache generation
- Repositories code generation (generated code for APIs)
- Service data attributes generation (generated extension classes for data objects)
The Magento software does not support the multi-tenant compiler, which includes the
bin/magento setup:di:compile-multi-tenant command.
To run the single-tenant compiler:
1 bin/magento setup:di:compile
1 Generated code and dependency injection configuration successfully.
To compile code before installing the Magento application:
In some cases, you might want to compile code before you install the Magento application.
Enable the modules.
bin/magento module:enable --all [-c|--clear-static-content]
[-c|--clear-static-content]option to clear static content. This is necessary if you previously enabled or disabled modules and you must clear the static content previously generated for them.
See Enable modules.
Compile the code.
Generated code and dependency injection configuration successfully.
To compile code without a database, see Deploy static view files without installing Magento.