5

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

  • are you work on local server? – Ajay Patel Mar 15 '17 at 9:49
  • I am getting on both local server as well as production.. – zed Blackbeard Mar 15 '17 at 10:02
  • just set permission for vendor, var and pub please check – Ajay Patel Mar 15 '17 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 Mar 15 '17 at 10:07
9

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
0

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, privacy policy and cookie policy

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