How to Fix Exceptions During Magento 2 Installation

- E-Commerce, Fire development, Magento 2

Magento 2 export CLI

Another Magento 2 issue that users often report is related to the installation procedure. A variety of exceptions occur, preventing the usual functionality. Below, we shed light on how to solve this problem. More useful tips are available here: Magento 2 Cookbook. If you need to fix exceptions that occur after the installation, check this article: How to fix the inability to write to the generated/code directory in Magento 2.

Issue

If you noticed exceptions displayed during installation, you’ve come to the right place. It is a quite common issue. Magento 2 users have reported a variety of exceptions, trying to install the software. 

You may see the following exceptions as well as numerous others:

Solution

Although the issue may seem terrifying, there is nothing to be afraid of. Furthermore, the solution is as simple as possible. You need to clean several directories and try the installation again to fix exceptions during the Magento 2 installation. That’s it. Use the following code to clear <magento_root>/generated/code and other directories under var and generated

Now, try to install Magento 2 once again. This time, no exceptions should occur. For further information, check this material: Exceptions during installation.