1

I'm trying to install magento2 from console. I use following:

php setup/index.php install
--db_host=localhost
--db_name=magento2ce 
--db_user=root
--db_pass=root
--backend_frontname=admin
--admin_username=admin
--admin_password=q111111
--admin_email=test@domain.com
--admin_firstname=admin
--admin_lastname=admin

And I'm getting following error:

Installing data.. PHP Fatal error:  Class 'Magento\Framework\App\DeploymentConfig\DbConfig' not found in /var/www/m2.dev/www/magento2ee/lib/internal/Magento/Framework/ForeignKey/Config/Reader.php on line 100

I see, that there no such file in the described directory. I have only 2 files in

/lib/internal/Magento/Framework/App/DeploymentConfig/

They are: Reader.php and Writer.php


When I execute

php bin/magento setup:install

with any params I'm getting

  [InvalidArgumentException]
  Command "setup:install" is not defined.
  Did you mean this?
      setup:config:set

After installation from console when I run from browser http://magehost/index.php I'm getting following:

Please update your database: Run "php -f index.php update" from the Magento root/setup directory. %1The following modules are outdated:%2%3
#0 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#1 /var/www/m2.dev/www/magento2ce/lib/internal/Magento/Framework/Interception/Chain/Chain.php(63): call_user_func_array(Array, Array)
#2 /var/www/m2.dev/www/magento2ce/lib/internal/Magento/Framework/Interception/Chain/Chain.php(58): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#3 /var/www/m2.dev/www/magento2ce/app/code/Magento/PageCache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#4 [internal function]: Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#5 /var/www/m2.dev/www/magento2ce/lib/internal/Magento/Framework/Interception/Chain/Chain.php(63): call_user_func_array(Array, Array)
#6 /var/www/m2.dev/www/magento2ce/var/generation/Magento/Framework/App/FrontController/Interceptor.php(95): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#7 /var/www/m2.dev/www/magento2ce/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php(68): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\App\FrontController\{closure}(Object(Magento\Framework\App\Request\Http))
#8 [internal function]: Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#9 /var/www/m2.dev/www/magento2ce/var/generation/Magento/Framework/App/FrontController/Interceptor.php(100): call_user_func_array(Array, Array)
#10 /var/www/m2.dev/www/magento2ce/var/generation/Magento/Framework/App/FrontController/Interceptor.php(124): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#11 /var/www/m2.dev/www/magento2ce/lib/internal/Magento/Framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#12 /var/www/m2.dev/www/magento2ce/lib/internal/Magento/Framework/App/Bootstrap.php(245): Magento\Framework\App\Http->launch()
#13 /var/www/m2.dev/www/magento2ce/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#14 {main}

Running update doesn't help, I got following error:

PHP Fatal error:  Call to undefined method Magento\Framework\App\DeploymentConfig::getSegment() in /var/www/m2.dev/www/magento2ee/lib/internal/Magento/Framework/ForeignKey/Config/Reader.php on line 100
| improve this question | | | | |
3

I'm not sure the install works like that for later versions.
Try to install it via this command:

php bin/magento setup:install {all your params here}
| improve this answer | | | | |
  • [InvalidArgumentException] Command "setup:install" is not defined. Did you mean this? setup:config:set – zhartaunik May 11 '15 at 14:11
  • That's strange. What version are you trying to install? If you run just php bin/magento you should see a list of available commands. setup:install should be one of them. – Marius May 11 '15 at 14:27
  • const VERSION = '0.42.0-beta11'; – zhartaunik May 11 '15 at 14:38
  • Try using the latest version. 0.74.0-beta8. It came out last friday. There is no point in still using the version you use. – Marius May 11 '15 at 14:47
  • Thanks for your response, I postpone this.. Return in few days. – zhartaunik May 11 '15 at 21:03
0

set the right permissions first then use the installer on the console with the parameters below

find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;
find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;
chmod u+x bin/magento;
bin/magento setup:install\
    --db-host=127.0.0.1\
    --db-name=dbname\
    --db-user=root\
    --db-password=root\
    --backend-frontname=admin\
    --admin-user=admin\
    --admin-password=„password123“\
    --admin-email=yourmail@mail.com\
    --admin-firstname=John\
    --admin-lastname=Doe\
    --use-sample-data\
    --base-url="http://mage.local“\
    --language=en_US\
    --timezone="Europe

omit the param --use-sample-data if you don not want to install sample data

bin/magento setup:upgrade
bin/magento indexer:reindex
bin/magento cache:clean
bin/magento deploy:mode:set
| improve this answer | | | | |
  • I think my issue isn't actual anymore, as it was long ago and magento don't use setup/index.php – zhartaunik Jun 5 '17 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.