PHP Warning:  require(/var/www/html/magento2/bin/../app/bootstrap.php): failed to open stream: No such file or directory in /var/www/html/magento2/bin/magento on line 14

PHP Fatal error:  require(): Failed opening required '/var/www/html/magento2/bin/../app/bootstrap.php' (include_path='.:/usr/share/php') in /var/www/html/magento2/bin/magento on line 14

Error when execute sudo php bin/magento setup:upgrade

  • Deleting var/generation, var/cache and var/di Oct 10, 2019 at 7:45
  • can you share a screenshot?
    – Mohit Rane
    Oct 10, 2019 at 10:20

2 Answers 2


Please make sure the file /var/www/html/magento2/app/bootstrap.php is available.

No such file or directory

This error indicates it is not.

Also make sure to set correct permission to your files as described:

With sudo this shouldn't be a problem, nevertheless I recommend not using super user.


Check the folders and files permissions.

Go to the core project folder and run the next commands:

find . -type f -exec chmod 644 {} \; && find . -type d -exec chmod 755 {} \; && find ./var -type d -exec chmod 777 {} \; && find ./pub/media -type d -exec chmod 777 {} \; && find ./pub/static -type d -exec chmod 777 {} \;

chmod 777 ./app/etc && chmod 644 ./app/etc/*.xml && chmod +x bin/magento

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.