8

I am getting following error on whole website even i am not able to open admin panel.

enter image description here

I have set all the permissions ( pub, var to 0777 ) as required for magento 2 project.

Any help would be appreciated!

Thanks in advance

4
  • are you work on local server?
    – Ajay Patel
    Commented Mar 15, 2017 at 9:49
  • I am getting on both local server as well as production.. Commented Mar 15, 2017 at 10:02
  • just set permission for vendor, var and pub please check
    – Ajay Patel
    Commented Mar 15, 2017 at 10:04
  • did u migrate local files to production server?Look into var/log/system.log file and give more detailed information about error
    – vijay b
    Commented Mar 15, 2017 at 10:07

2 Answers 2

17

If you take a look at vendor/magento/magento2-base/app/autoload.php, you'll notice following piece of code:

define('VENDOR_PATH', BP . '/app/etc/vendor_path.php');

if (!file_exists(VENDOR_PATH)) {
    throw new \Exception(
        'We can\'t read some files that are required to run the Magento application. '
         . 'This usually means file permissions are set incorrectly.'
    );
}

That means that either you don't have app/etc/vendor_path.php file, or you're not having enough permissions.

In order to fix permissions, you can run all of those commands, or at least the last two since you haven't mentioned that you've configured permissions on app/:

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
1
  • when I run these commands, my git bash stops responding and does nothing, why is this? Commented Jun 30, 2022 at 17:01
2

If you get this issue on magento cloud, you may have run the local:build command which at the moment clears out the app/etc folder and moves it to init/app/etc amongst other things. I know that I will only run this command on a cloned Virtual Machine from now on as it appears to do more harm than good.

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.