I am getting following error on whole website even i am not able to open admin panel.
I have set all the permissions ( pub, var to 0777 ) as required for magento 2 project.
Any help would be appreciated!
Thanks in advance
I am getting following error on whole website even i am not able to open admin panel.
I have set all the permissions ( pub, var to 0777 ) as required for magento 2 project.
Any help would be appreciated!
Thanks in advance
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
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.