when I install a new theme I do this commands via Putty:

php bin/magento setup:upgrade 

how can I fix this problem? I'm working on Magento 2.1.0

PHP Warning: Uncaught Exception: Warning: require(/var/www/vhosts/a.com/httpdocs/setup/config/application.config.php): failed to open stream: No such file or directory in /var/www/vhosts/a.com/httpdocs/vendor/magento/framework/Console/Cli.php on line 57 in /var/www/vhosts/a.com/httpdocs/vendor/magento/framework/App/ErrorHandler.php:61

  • Please check,it may cause of permission. Commented Nov 16, 2017 at 2:40

6 Answers 6


Your site miss the file /var/www/vhosts/a.com/httpdocs/setup/config/application.config.php, you could copy it from original official install files.

Also a possibility, the file application.config.php or the directory /var/www/vhosts/a.com/httpdocs/setup/config/ lack permission, try to give it read and write permission.

  • setup folder not in httpdocs
    – Amd2030
    Commented Nov 16, 2017 at 17:54
  • 1
    @Amd2030 Setup folder not in httpdocs indicates that your installation is not complete, please download again from official page magento.com/tech-resources/download
    – Key Shang
    Commented Nov 17, 2017 at 1:28
  • had this happen when cloning a site - setup didn't copy for some reason. Upload the setup folder into the base - php bin/magento setup:upgrade > php bin/magento setup:di:compile > php bin/magento setup:static-content:deploy -s standard = problem fixed for me. Thanks.
    – dawhoo
    Commented Sep 24, 2018 at 16:19

I just ran into this same issue; it happened to me because a composer update failed in the middle of its process and did not clean up correctly, leading to a corrupted vendor asset.

The easiest way to fix this is to remove your vendor/ folder and reinstall vendor assets from composer.lock:

  1. rm -rf vendor/
  2. composer install

After running the above, bin/magento set:up should work as expected.


first: setup folder not there so, i install a new and clear installation 
second: my hosting use Plesk so all command should be with the path of php
the replacment code of

php bin/magento setup:upgrade 


/opt/plesk/php/5.6/bin/php bin/magento setup:upgrade 


I've also face this issue when setup:upgrade, if you not install magento properly then some files missing in root directories, so best option is download files from magento official side related your magento version.

And regarding your issue add setup/config/application.config.php after check "app/" in all files and "etc/" in all files with magento default. then

rm -rf var/page_cache/ var/cache/ pub/static/frontend/ generated/ && php bin/magento setup:upgrade  && php bin/magento setup:di:compile

I used the following command to manually copy any files from magento2-base/composer.json map-section to the magento root directory:

cat vendor/magento/magento2-base/composer.json | jq '.extra.map[][1]' | xargs -n1 -I'{}' bash -c 'echo -n "{}"; if [ -d "vendor/magento/magento2-base/{}" ]; then echo -n "/"; fi; echo' | xargs -n1 -I'{}' rsync -a --delete 'vendor/magento/magento2-base/{}' '{}'

Deleting manually

  • var/generation
  • var/cache
  • var/view_preprocessed
  • var/page_cache
  • var/di

solved it for me.

or by using ssh you can run below commands

rm -rf var/cache/* var/generation/* var/view_preprocessed/* var/page_cache/* var/di/*

Hope this will help.

  • after run previous commands: # var/generation/* -bash: var/generation/Composer: Is a directory # var/view_preprocessed/* -bash: var/view_preprocessed/css: Is a directory # var/page_cache/* -bash: var/page_cache/mage--0: Is a directory # var/di/* -bash: var/di/adminhtml.ser: Permission denied
    – Amd2030
    Commented Nov 16, 2017 at 18:09
  • Hi, I have updated a script.
    – Meetanshi
    Commented Nov 17, 2017 at 3:45
  • still not working
    – Amd2030
    Commented Nov 17, 2017 at 21:16
  • this doesn't work
    – dchayka
    Commented Jul 18, 2018 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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