magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.57k stars 9.32k forks source link

Unable to install magento2 after taking the latest code from github #668

Closed sakashNeev closed 10 years ago

sakashNeev commented 10 years ago

When I check my apache error log. It gives me the following error:-

PHP Fatal error: Class 'Zend\Mvc\Service\ServiceManagerConfig' not found in /var/www/magento2/setup/index.php on line 32

hafeez3000 commented 10 years ago

Get latest code and try again to install.

sakashNeev commented 10 years ago

Tried with the fresh code the problem still persists:-

[Tue Sep 16 18:05:40 2014] [error] [client 127.0.0.1] PHP Warning: include(vendor/autoload.php): failed to open stream: No such file or directory in /var/www/magento2/setup/index.php on line 25 [Tue Sep 16 18:05:40 2014] [error] [client 127.0.0.1] PHP Warning: include(): Failed opening 'vendor/autoload.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/magento2/setup/index.php on line 25 [Tue Sep 16 18:05:40 2014] [error] [client 127.0.0.1] PHP Fatal error: Class 'Zend\Mvc\Service\ServiceManagerConfig' not found in /var/www/magento2/setup/index.php on line 32

The warnings in this case is beacuse of composer.phar not being present (which should be noted is not available with the checkout ).

I checked at the below loaction : /var/www/magento2/lib/internal/Zend Mvc folder doesn't seem to be present.

ivanweiler commented 10 years ago

Same errors here. But, even if you resolve autoloader and dependencies with Composer, setup isn't working properly. The worst thing is, I can't run Magento on previous database because something is changed on log tabels or similar and I can't re-install :(

mazhalai commented 10 years ago

Please run composer install within the setup directory before setup.

sakashNeev commented 10 years ago

Thanks mazhalai , that did help solve the above error ! However it is now stuck with the below error:

[Wed Sep 17 10:12:14 2014] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'Zend\I18n\Exception\ExtensionNotLoadedException' with message 'Zend\I18n\Translator component requires the intl PHP extension' in /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php:257\nStack trace:\n#0 /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php(353): Zend\I18n\Translator\Translator->getLocale()\n#1 /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/Mvc/I18n/Translator.php(73): Zend\I18n\Translator\Translator->translate('An error occurr...', 'default', NULL)\n#2 /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/I18n/View/Helper/Translate.php(38): Zend\Mvc\I18n\Translator->translate('An error occurr...', 'default', NULL)\n#3 [internal function]: Zend\I18n\View\Helper\Translate->__invoke('An error occurr...')\n#4 /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php(399): call_user_func_array(Objec in /var/www/magento2/setup/vendor/zendframework/zendframework/library/Zend/I18n/Translator/Translator.php on line 257

Which suggests me to install php5-intl extension.

However after doing that the following error comes up:-

A 404 error occurred Page not found.

The requested controller could not be mapped to an existing controller class.

Controller: Magento\Setup\Controller\En_US\IndexController(resolves to invalid controller class or alias: Magento\Setup\Controller\En_US\IndexController)

No Exception available

ivanweiler commented 10 years ago

Just confirming that the problem exists. New setup isn't working after you resolve dependencies with composer install, you get described 404 errors.

ivanweiler commented 10 years ago

Setup won't run at all because my Magento2 is in subfolder (www.example.com/magento2/) and it seems Magento\Setup\Mvc\Router\Http\Setup::match() is not aware of that, namespace/controller is resolved wrong there because of subfolder.

I tweaked it and manage to run new setup. While installing (on empty db) there was one error in setup console: [ERROR] exception 'PDOException' with message 'SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'crc_string'' in C:\wamp\www\magento2\setup\vendor\zendframework\zendframework\library\Zend\Db\Adapter\Driver\Pdo\Connection.php:435 ..

4 C:\wamp\www\magento2\app\code\Magento\Core\sql\core_setup\upgrade-1.6.0.2-1.6.0.3.php(50): Magento\Framework\DB\Adapter\Pdo\Mysql->addColumn('core_translate', 'crc_string', Array)

.. [SUCCESS] Magento_Core ... installed [SUCCESS] Magento_Authorization ... installed .. [SUCCESS] Magento_CurrencySymbol ... installed [SUCCESS] Magento_Wishlist ... installed [SUCCESS] Artifact ... installed

Tables were created, so I tried to run Magento, but it crashed with following message: "Looks like database is outdated. Please, use setup tool to perform update"

Hope it helps ..

Marko-M commented 10 years ago

I can confirm ivanweiler findings at my local install with alpha95. Alpha 94 works fine though but only with old database and trying to upgrade doesn't work (do not have error at hand).

tzyganu commented 10 years ago

Here are the list of steps I followed. And where I got stuck. Listing them here in case someone else wants to take over.

  1. git clone this repo
  2. composer install in the root of the project
  3. composer install in the setup folder
  4. Enabled php_intl extension
  5. Created a virtual host magento2.local. as @ivanweiler pointed out, the install gives an error when on a subfolder.
  6. Finally was able to rung the install. I was happy, but wait...there's more.
  7. 2.4 eternities later I found the Artefact installed message but the installer was only at 96 percent.
  8. Still got the error because magento tests the module version for the modules that don't have a setup script. So I manually added them to the core_resource table
    
    INSERT INTO core_resource values ('dhl_setup', '2.0.0.0', '2.0.0.0');
    INSERT INTO core_resource values ('fedex_setup', '2.0.0.0', '2.0.0.0');
    INSERT INTO core_resource values ('checkout_setup', '1.6.0.0', '1.6.0.0');
    INSERT INTO core_resource values ('groupedproduct_setup', '0.0.1', '0.0.1');
    INSERT INTO core_resource values ('ogone_setup', '1.6.0.0', '1.6.0.0');
    INSERT INTO core_resource values ('configurableproduct_setup', '1.0.0.0', '1.0.0.0');
    INSERT INTO core_resource values ('usps_setup', '2.0.0.0', '2.0.0.0');
    
    9.I found that the data install/update scripts never run. So I looked in the install script and manually executed from cli > php dev/shell/run_data_fixtures.php. I'm not sure but maybe step 8 can be skipped. I only realized that the data is not there only after inserting the values in core_resource.

At this point I get an error saying "Current store is not active" on frontend and I can access the admin login page but I'm not able to login.

I will add more details as soon as I find them.

tzyganu commented 10 years ago

Correction for steps 8 and 9. If you first run the data updates script you don't need to insert the values in the core_resource table.
Just run UPDATE core_resource set version = data_version; because the version field for the modules mentioned at step 8 is NULL and you still get the database not up to date error.

tzyganu commented 10 years ago

OK. I've done it. Here are the steps I've taken. Sorry for kind of spamming this, but I think it's important to have a clean view.:

  1. git clone this repo
  2. composer install in the root of the project
  3. composer install in the setup folder
  4. Enabled php_intl extension
  5. Created a virtual host magento2.local. as @ivanweiler pointed out, the install gives an error when on a subfolder.
  6. Edit /setup/module/Magento/Setup/src/Model/AdminAccount.php and replace $this->setup->getConnection()->insert($this->setup->getTable('admin_role'), $role, true); with $this->setup->getConnection()->insert($this->setup->getTable('authorization_role'), $role, true); because the table admin_role is renamed to authorization_role in the /app/code/Magento/Authorization/sql/authorization_setup/install-1.0.0.0.php install script.
  7. Run installer - grow a beard maybe while it's running because it takes a loooong time.
  8. After seeing the message Artefact installed look in the admin_user table. If a user is there it means it is stuck either on updating the app/etc/local.xml or while running the data updates.
  9. run > php dev/shell/run_data_fixtures.php for data updates
  10. Run UPDATE core_resource set version = data_version because some modules are taken into consideration when running the data updates but not the schema updates.
  11. Change in Magento\Store\Model\StorageFactory::__construct parameters

    $defaultStorageClassName = 'Magento\Store\Model\Storage\DefaultStorage', to
    $defaultStorageClassName = 'Magento\Store\Model\Storage\Db',
    Maybe this last step is wrong, but if I change it it works. If I don't...I get 'current store is not enabled'.

antonmakarenko commented 10 years ago

@tzyganu Thank you very much for such a detailed report. We have already fixed most of the issues you described and prepping them for pushing to GitHub.

And we are aware of the performance issue you pointed out in the # 7 (that one is not fixed yet)

SRaromicon commented 10 years ago

Setup really sucks and it takes so long. My Setup stucks at 5% and jump to 20% and stucks again. I'm running the setup on a 24 core 64GB Ram Server with Percona and PHP5 FPM and nginx. Magento 1.9 is installed in 30sec. Installation is now running 14min and catalog_products table are finished. I will post a screen shot of table creation when it is finished.

verklov commented 10 years ago

Thank you all for reporting this issue, discussing it here and providing useful details to the team! The team reported of fixing this issue internally. The code with the fix must be now available on the GitHub deployed in version 0.1.0-alpha96. We are closing this issue.

SRaromicon commented 10 years ago

The issue is not fixed. Installation stops at 96% and it is very slow. There some strange SQL Selects at Setup. They take 8 Seconds and will be performed on every connect to database.

547 Query SELECT DATABASE() 547 Query SELECT 'T'.'TABLE_NAME', 'T'.'TABLE_TYPE', 'V'.'VIEW_DEFINITION', 'V'.'CHECK_OPTION', 'V'.'IS_UPDATABLE' FROM 'INFORMATION_SCHEMA'.'TABLES'T LEFT JOIN 'INFORMATION_SCHEMA'.'VIEWS' V ON 'T'.'TABLE_SCHEMA' = 'V'.'TABLE_SCHEMA' AND 'T'.'TABLE_NAME' = 'V'.'TABLE_NAME' WHERE 'T'.'TABLE_TYPE' IN ('BASE TABLE', 'VIEW') AND 'T'.'TABLE_SCHEMA' = 'magento2'

140919 20:29:39 547 Query SELECT 'C'.'ORDINAL_POSITION', 'C'.'COLUMN_DEFAULT', 'C'.'IS_NULLABLE', 'C'.'DATA_TYPE', 'C'.'CHARACTER_MAXIMUM_LENGTH', 'C'.'CHARACTER_OCTET_LENGTH', 'C'.'NUMERIC_PRECISION', 'C'.'NUMERIC_SCALE', 'C'.'COLUMN_NAME', 'C'.'COLUMN_TYPE' FROM 'INFORMATION_SCHEMA'.'TABLES'T INNER JOIN 'INFORMATION_SCHEMA'.'COLUMNS'C ON 'T'.'TABLE_SCHEMA' = 'C'.'TABLE_SCHEMA' AND 'T'.'TABLE_NAME' = 'C'.'TABLE_NAME' WHERE 'T'.'TABLE_TYPE' IN ('BASE TABLE', 'VIEW') AND 'T'.'TABLE_NAME' = 'core_theme_files' AND 'T'.'TABLE_SCHEMA' = 'magento2'

`140919 20:29:41 547 Query SELECT 'T'.'TABLE_NAME', 'TC'.'CONSTRAINT_NAME', 'TC'.'CONSTRAINT_TYPE', 'KCU'.'COLUMN_NAME', 'RC'.'MATCH_OPTION', 'RC'.'UPDATE_RULE', 'RC'.'DELETE_RULE', 'KCU'.'REFERENCED_TABLE_SCHEMA', 'KCU'.'REFERENCED_TABLE_NAME', 'KCU'.'REFERENCED_COLUMN_NAME' FROM 'INFORMATION_SCHEMA'.'TABLES' T INNER JOIN 'INFORMATION_SCHEMA'.'TABLE_CONSTRAINTS' TC ON 'T'.'TABLE_SCHEMA' = 'TC'.'TABLE_SCHEMA' AND 'T'.'TABLE_NAME' = 'TC'.'TABLE_NAME' LEFT JOIN 'INFORMATION_SCHEMA'.'KEY_COLUMN_USAGE' KCU ON 'TC'.'TABLE_SCHEMA' = 'KCU'.'TABLE_SCHEMA' AND 'TC'.'TABLE_NAME' = 'KCU'.'TABLE_NAME' AND 'TC'.'CONSTRAINT_NAME' = 'KCU'.'CONSTRAINT_NAME' LEFT JOIN 'INFORMATION_SCHEMA'.'REFERENTIAL_CONSTRAINTS' RC ON 'TC'.'CONSTRAINT_SCHEMA' = 'RC'.'CONSTRAINT_SCHEMA' AND 'TC'.'CONSTRAINT_NAME' = 'RC'.'CONSTRAINT_NAME' WHERE 'T'.'TABLE_NAME' = 'core_theme_files' AND 'T'.'TABLE_TYPE' IN ('BASE TABLE', 'VIEW') AND 'T'.'TABLE_SCHEMA' = 'magento2' ORDER BY CASE 'TC'.'CONSTRAINT_TYPE' WHEN 'PRIMARY KEY' THEN 1 WHEN 'UNIQUE' THEN 2 WHEN 'FOREIGN KEY' THEN 3 ELSE 4 END, 'TC'.'CONSTRAINT_NAME', 'KCU'.'ORDINAL_POSITION'``

Marko-M commented 10 years ago

I can confirm SRaromicon findings. Setup dies at 96%.

buskamuza commented 10 years ago

You're right. The new setup installer is broken now. The fix will be available with one of the next publications. Meanwhile, please, use old CLI installation script:

php –f dev/shell/install.php -- --license_agreement_accepted yes --locale en_US --timezone "America/Los_Angeles" --default_currency USD --db_host localhost --db_name magento2 --db_user root --url "http://magento2.lh/" --use_rewrites no --use_secure_admin yes --admin_lastname Admin --admin_firstname Admin --admin_email "admin@example.com" --admin_username admin --admin_password password --use_secure no --secure_base_url "https://magento2.lh/" --cleanup_database --skip_url_validation yes

Just substitute necessary values with yours.

Marko-M commented 10 years ago

Thanks @buskamuza, shell install works fine. One thing to note, it's required to add --user_pass argument if database user has password set.

SRaromicon commented 10 years ago

Yes shell install works fine and it's really fast and has no performance issues. Only the db_pass parameter is missing in the example of the installer.php

sakashNeev commented 10 years ago

Steps I followed:-

1) git clone https://github.com/magento/magento2.git

2) Ran composer install inside the setup directory

3) Create vhost with name magento2-local.com

4) Provide necessary file permissions

5) Try GUI install, which I gave up after 5% and checked in database as were only 13 tables created.

6) Delete local.xml

7) Try installing via command line

root@INPUNNEEV003:/var/www/magento2# php –f dev/shell/install.php -- --license_agreement_accepted yes --locale en_US --timezone "America/Los_Angeles" --default_currency USD --db_host localhost --db_name magento2 --db_user root --db_pass root --url "http://magento2-local.com/" --use_rewrites no --use_secure_admin yes --admin_lastname Admin --admin_firstname Admin --admin_email "admin@example.com" --admin_username admin --admin_password password --use_secure no --secure_base_url "https://magento2-local.com/" --cleanup_database --skip_url_validation yes
Could not open input file: –f

8) Try removing -f from above command

root@INPUNNEEV003:/var/www/magento2# php dev/shell/install.php -- --license_agreement_accepted yes --locale en_US --timezone "America/Los_Angeles" --default_currency USD --db_host localhost --db_name magento2 --db_user root --db_pass root --url "http://magento2-local.com/" --use_rewrites no --use_secure_admin yes --admin_lastname Admin --admin_firstname Admin --admin_email "admin@example.com" --admin_username admin --admin_password password --use_secure no --secure_base_url "https://magento2-local.com/" --cleanup_database --skip_url_validation yes
exception 'Exception' with message 'Recoverable Error: Object of class Magento\Framework\Message\Error could not be converted to string in /var/www/magento2/app/code/Magento/Install/App/Console.php on line 123' in /var/www/magento2/lib/internal/Magento/Framework/App/ErrorHandler.php:77
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(4096, 'Object of class...', '/var/www/magent...', 123, Array)
#1 /var/www/magento2/app/code/Magento/Install/App/Console.php(123): implode('\n', Array)
#2 /var/www/magento2/app/code/Magento/Install/App/Console.php(159): Magento\Install\App\Console->_handleInstall(Object(Magento\Install\Model\Installer\Console))
#3 /var/www/magento2/lib/internal/Magento/Framework/App/Bootstrap.php(203): Magento\Install\App\Console->launch()
#4 /var/www/magento2/dev/shell/install.php(107): Magento\Framework\App\Bootstrap->run(Object(Magento\Install\App\Console))
#5 {main}

9) The tables seem to have been created. There are 309 of them.

10) Try http://magento2-local.com/admin as well as http://magento2-local.com/ it gives 404 page.

For me neither the command line install works nor the GUI

yhingyu commented 10 years ago

I have successfully installed in xampp. Using the command line , I used this setup: php -f dev/shell/install.php -- --license_agreement_accepted yes --locale en_US --timezone "Asia/Taipei" --default_currency USD --db_host localhost --db_name magento2 --db_user root --url "http://localhost/magento2/" --use_rewrites yes --use_secure_admin no --admin_lastname Admin --admin_firstname Admin --admin_email "admin@example.com" --admin_username admin --admin_password admin1234 --use_secure no --secure_base_url "https://localhost/magento2/" --cleanup_database --skip_url_validation yes

sakashNeev commented 10 years ago

Ok, this is the one that finally worked:

root@INPUNNEEV003:/var/www/magento2# php -f dev/shell/install.php -- --license_agreement_accepted yes --locale en_US --timezone "Asia/Calcutta" --default_currency USD --db_host localhost --db_name magento2 --db_user root --db_pass root --url "http://magento2-local.com/" --use_rewrites yes --use_secure_admin no --admin_lastname Admin --admin_firstname Admin --admin_email "sakash@neevtech.com" --admin_username admin --admin_password admin1234 --use_secure no --secure_base_url "https://magento2-local.com/" --cleanup_database --skip_url_validation yes

The change being it seems in the value of parameters --use_rewrites no --use_secure_admin yes to --use_rewrites yes --use_secure_admin no

Thank you Edixon Yu Jr. yhingyu for helping out.

asif-hhh commented 10 years ago

I am facing a redirect 404 issue while installing Magento 2. here are the steps i followed

1- git clone this repo 2- composer install in the root of the project 3- composer install in the setup folder 4- Enabled php_intl extension 5 - Created a virtual host magento2dev.com

Now when in browser, i run http://magento2dev.com This redirects me to 404 http://magento2dev.com/setup/en_US/index

Nothing is displayed in log ...

Using version alpha95, and now tried alpha96 But same problem.

any suggestions ???

alankent commented 10 years ago

Sorry for delay in response. Did you run the command line install script? There is an installation step to create database, local.xml file etc. We are removing the installation process from the store front, but might not have good error messages in its place yet. (I am guessing here - I have not tried it myself yet.)

georgiandinca commented 10 years ago

I have done today a fresh install with current git version code.

found almost same issues with the frontend installer page - need to run composer install, then install php_intl extenstion... all modules were installed fine till get a final error regarding fisture dat aupdates. So I exit to console, run the

php dev/shell/run_data_fixtures.php

Come back and retry the installation and finally get the end but the frontend did not load the CSS and the backend give an error ... still trying :)

mazhalai commented 10 years ago

@georgiandinca, what server are you using? In Apache, please make sure mod_rewrite is enabled, as well as .htaccess is configured correctly to load css/js/image files. For Nginx, settings are here: #586

georgiandinca commented 10 years ago

@mazhalai, I use an apache web server and it has mod_rewrite enabled but I'll check if something is wrong with the .htaccess configuration. Thanks

htongaria commented 9 years ago

While installing Magento 2 (Downloaded on 18 Nov, 2015) on my local Wamp Server (Windows 10) I am receiving error: Readiness Check: 1 PHP Extension missing --> PHP Extension intl

After cross check my configuration I found that the extention is active.

What could be the problem and how to resolve.

mazhalai commented 9 years ago

@htongaria can you please elaborate how did you check your configuration? using phpinfo()? or php -m? Also, please avoid commenting on closed issues, it would be better to create a new issue.

zulkhaery commented 8 years ago

Install magento2 on trusty 14.04, nginx 1.8, mysql 5.6, php-fpm 5.6, using compser: http://magento2.local/setup

Magento A 404 error occurred Page not found

The requested URL could not be matched by routing.

No Exception available

yashodhank commented 7 years ago

Debian 8 (64 bit) php 7.1 fpm

Error: The following error has occurred during the installation of application:
Installation of magento at https://stage.xxxxx.com/ failed. Non-zero exit status returned by script. Output stream: 'PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'Parameter validation failed' in /var/www/vhosts/stage.xxxxx.com/httpdocs/setup/src/Magento/Setup/Console/Command/InstallCommand.php:150
Stack trace:
#0 /var/www/vhosts/stage.xxxxx.com/httpdocs/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(236): Magento\Setup\Console\Command\InstallCommand->initialize(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/vhosts/stage.xxxxx.com/httpdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/vhosts/stage.xxxx.com/httpdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Setup\Console\Command\InstallCommand), Object(Symfony\Component\Console\Input in /var/www/vhosts/stage.xxxxxx.com/httpdocs/setup/src/Magento/Setup/Console/Command/InstallCommand.php on line 150
'. Error stream: 'PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'Parameter validation failed' in /var/www/vhosts/stage.xxxx.com/httpdocs/setup/src/Magento/Setup/Console/Command/InstallCommand.php:150
Stack trace:
#0 /var/www/vhosts/stage.xxxxx.com/httpdocs/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(236): Magento\Setup\Console\Command\InstallCommand->initialize(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/vhosts/stage.xxxxxx.com/httpdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/vhosts/stage.xxxxxx.com/httpdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Magento\Setup\Console\Command\InstallCommand), Object(Symfony\Component\Console\Input in /var/www/vhosts/stage.xxxxx.com/httpdocs/setup/src/Magento/Setup/Console/Command/InstallCommand.php on line 150
'.