How to Run Compile Command Line in Magento 2
In this tutorial, we will talk about How to Run Compile Command Line in the continuation of the Command Line Series.
As you know, from Magento 2, they add many commands in
bin/magento. To make it easier to understand and practice while the compilation process might take a longer time, I will show you how to run compile command line correctly.
Steps to Run Compile Command Line
Go to Magento admin root folder and show usage:
php bin/magento setup:di:compile --help
Usage: setup:di:compile Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug Help: Generates DI configuration and all missing classes that can be auto-generated
Syntax to Unlock Admin user
php bin/magento setup:di:compile
Output of compilation :
Compilation was started. Interception cache generation... 7/7 [============================] 100% 19 secs 280.0 MiB Generated code and dependency injection configuration successfully.
It’s pretty easy to run compile command line in Magento 2, right? I hope you follow this tutorial and get things done easily. Don’t forget to share this post with your Magento friends to help them out. Feel free to contact us for a further discussion.
Thanks for reading!
- How to create a simple Hello World module for Magento 2
- Magento 2 Block Template Ultimate Guides
- How to Create Module in Magento 2
- How to Create Controller in Magento 2
- How to create CRUD Models in Magento 2
- View: Layouts, Block and Templates
- Configuration - System.xml
- How To Create Admin Menu In Magento 2
- Admin ACL
Enjoyed the tutorial? Spread it to your friends!
Sam is the CEO and Founder of Mageplaza, pursuing a simple and healthy lifestyle. He is a friend, a husband, and a father to two children. As a trainer and an aspiring influencer, he is also a big fan of sports and travel. Sam is exceptionally knowledgeable about e-commerce, especially Magento and Shopify, with 10 years of experience in the field.