Magento Setup Upgrade Error – Deployment Configuration is Absent

magento2upgrade

When I try to upgrade Magento 2 php bin/magento setup:upgrade I get

I get

[Magento\Setup\Exception]
Can't run this operation: deployment configuration is absent. Run
'magento setup:config:set –help' for options. setup:upgrade

[–keep-generated] [–magento-init-params="…"]

How to fix it? Updating using the web updater gives the following errors:

enter image description here

I asked my hosting provider to fix them and they did install the right php version 5.6 and all extensions recommended by magento and created a cron job but I still see the error.


UPDATE: (from comments)
env.php wasn't there, when I run magento setup:config:set I get this error:

$ bin/magento setup:config:set
SQLSTATE[HY000] [2002] No such file or directory

[InvalidArgumentException]
Parameter validation failed

Best Answer

I ran into the same issue today. It appeared that the app/etc/env.php was missing. This means that Magento was not yet installed. During Magento installation it will create this file, so:

  • make sure app/etc/ is writable for the magento user/webuser
  • run bin/magento setup:install ...params...

In my case, some script that I made was not copying my env.php file into the app/etc/ folder.

It is also possible that the file is there, but it is not readable for the Magento user/webuser.