As all of you know we can install Magento 2 using setup wizard or using composer. I would like to know what are the other benefits (except up gradation of core modules) of installing Magento 2 using composer? and which way of installing is recommended?
which way of installing is recommended?
Better to go with Composer installation, it does a lot of checks. ( Some opinions may vary ).
Everyone who uses the Magento software must install Composer to update components and Magento. If you install Magento using an archive, you don't need Composer to install Magento, but you do need Composer for updates.
- Enables you to reuse third-party libraries without bundling them with source code.
- Component-based architecture with robust dependency management.
- Manages dependencies to reduce extension conflicts and compatibility issues.
- Versioned dependencies.
- Semantic versioning.
- Supports the PHP Framework Interoperability standard.
Some Useful points from Alexey B.
a) You have a project that depends on a number of libraries.
b) Some of those libraries depend on other libraries.
c) You declare the things you depend on.
d) Composer finds out which versions of which packages need to be installed, and installs them (meaning it downloads them into your project).
They are not the same thing. You don't install Magento using Composer, you install using the CLI or Setup Wizard.
You can get the Magento software in the following ways:
composer create-project(i.e., Composer)
git clone(cloning the repo, which you should do if you want to contribute code to CE)
- Compressed archive (
For each of the preceding, you can install the Magento software using either the Setup Wizard or command line.
Krishna's answer is very good for the benefits of
composer create-project but the archive is exactly the same, it's just already packaged for you.