Our Feature Items: SM Market // SM AutoStore // SP Revo
Shopping cart (0)

The Most Common Errors During Magento 2 Installation (Part1)

Rate this item
(1 Vote)
Written by  Sarah
Thursday, 12 April 2018 16:55
The Most Common Errors During Magento 2 Installation (Part1) - 5.0 out of 5 based on 1 vote

Hi folks, 

After introducing you How to install Magento 2 on XAMPP and How To Install Magento 2 on Centos Server, we got many questions related to the issues that you met when installing Magento 2 versions, so we decided to create this post to show you the most common errors during Magento 2 installation and give you the best solution one.

Magento Tutorials

1. Installation stops at about 70%

During installation using the Setup Wizard, the process stops at about 70% (with or without sample data). No errors display on the screen.

Common causes for this issue include:

Solution:

Set all of the following as appropriate.

All web servers and Varnish

  1. Locate your php.ini using a phpinfo.php file.
  2. As a user with root privileges, open php.ini in a text editor.
  3. Locate the max_execution_time setting.
  4. Change its value to 18000.
  5. Save your changes to php.ini and exit the text editor.
  6. Restart Apache:

    • CentOS: service httpd restart
    • Ubuntu: service apache2 restart

    If you use nginx or Varnish, continue with the following sections.

nginx only

If you use nginx, use our included nginx.conf.sample or add a timeout settings in the nginx host configuration file to the location ~ ^/setup/index.php section as follows:

location ~ ^/setup/index.php {
.....................
fastcgi_read_timeout 600s;
 fastcgi_connect_timeout 600s;
}

Restart nginx: service nginx restart

Varnish only

If you use Varnish, edit default.vcl and add a timeout limit value to the backend stanza as follows:

backend default {
.....................
 .first_byte_timeout = 600s;
}
Copy

Restart Varnish.

service varnish restart

2. Cannot install using nginx

If you use the nginx web server and you attempt to install the Magento software, the installation sometimes fails.

Detail

You can confirm the issue by the following error in the var/report directory:

NOTE: You cannot install Magento using the Setup Wizard because the Magento setup directory cannot be accessed.
You can install Magento using either the command line or you must restore access to the following directory: /var/www/html/setup
If you are using the sample nginx configuration, please go to http://ce.mtf03.bcn.magento.com/setup/";i:1;s:641:"#0 /var/www/html/lib/internal/Magento/Framework/App/Http.php(213): Magento\Framework\App\Http->redirectToSetup(Object(Magento\Framework\App\Bootstrap), Object(Exception))

Workaround

Append /setup to the URL by which you access the Setup Wizard or install the Magento software using the command line.

3. During installation, fatal PDO error displays

Details

PHP Fatal error:  Class 'PDO' not found in /var/www/html/magento2/setup/module/Magento/Setup/src/Module/Setup/ConnectionFactory.php on line 44

Solution:

Make sure you installed all required PHP extensions (CentOSUbuntu).

4. During installation, Reflection Exception error

Details

During the installation, a message similar to the following displays:

[ERROR] exception 'ReflectionException' with message 'Class Magento\Framework\StoreManagerInterface does not exist' 
in /<path>/lib/internal/Magento/Framework/Code/Reader/ClassReader.php

Solution

Clear all directories and files under Magento’s var subdirectory and install the Magento software again.

As the Magento file system owner or as a user with root privileges, enter the following commands:

cd <your Magento install directory>/var
rm -rf cache/* di/* generation/* page_cache/*

5. Download fails because of changes in Composer

Symptom

During download, the following error displays:

[ErrorException]
  	file_get_contents(app/etc/NonComposerComponentRegistration.php): failed to open stream: No such file or directory

Description

This happens because of changes in certain versions of Composer.

The workaround is to downgrade Composer to an earlier version and try your Magento download again.

Any version of Composer dated between November 21 and November 26, 2015 has this issue. To confirm this issue is related to the Composer version, enter the following command:

composer -v

The version displays similar to the following:

Composer version 1.0-dev (2b14f0a047dd4f3545ec82381f65c36ea93a4c81) 2015-11-25 17:13:09

Note the date is 2015-11-25, which indicates Composer has this issue.

To work around it:

  1. Change your version of Composer to enable you to download the Magento software by doing any of the following:

    • Downgrade Composer using the following command:

      composer self-update 1.0.0-alpha11
       
    • Upgrade Composer to a version later than November 26, 2015:

      composer self-update
       
  2. Delete your Magento 2 directory and subdirectories.
  3. Try the download again using either composer create-project or git clone.
  4. After successfully downloading the Magento software, update Composer:

    composer self-update
Google+
Joomla TemplatesFree Joomla TemplatesVirtuemart TemplatesK2 TemplatesJoomShopping TemplatesHikaShop TemplatesSobiPro TemplatesOpenCart Themes
Quà Tết Cao Cấp Hộp quà tết Giỏ quà tết Túi quà tết