0

I have installed Magento on a test Ubuntu 20.04.01 server via composer with the command:

composer create-project --repository=https://repo.magento.com/ magento/project-community-edition ~/magento --ignore-platform-reqs

After the installation, I created a symbolic link:

sudo ln -s /home/<loginname>/magento/vendor/magento/magento2-base /var/www/html/magento

When starting Magento, I receive an autoload error:

We can't read some files that are required to run the Magento application. This usually means file permissions are set incorrectly.

However, the file permissions have been set with the following command:

sudo find . -type f -exec chmod 644 {} \;
sudo find . -type f -exec chown www-data:www-data {} \;
sudo find . -type d -exec chmod 755 {} \;
sudo find . -type d -exec chown www-data:www-data {} \;
sudo find ./var -type d -exec chmod 777 {} \;
sudo find ./pub/media -type d -exec chmod 777 {} \;
sudo find ./pub/static -type d -exec chmod 777 {} \;
sudo chmod 777 ./app/etc
sudo chmod 644 ./app/etc/*.xml

On Magento 2 : getting Autoload error the user Sinisa Nedeljkovic wrote that it might be possible that the app/etc/vendor_path.php file is missing.

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.

And that is the case: that file is not present in the given folder.

So my question is: how do I get that file? Or copy it from ./vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/vendor_path.php?

Feedback is appreciated and with kind regards, TheStingPilot

9
  • You should link all Magento folder , not only vendor/Magento/magento-base. So all , everything inside like app/ vendor/ etc
    – BartZalas
    Nov 29, 2020 at 18:50
  • The only vendor_path.php file is found here: ./vendor/magento/magento2-base/dev/tests/integration/testsuite/Magento/Framework/Composer/_files/vendor_path.php And I assume that is not the one we are looking for. Nov 29, 2020 at 20:16
  • What I mean this is wrong : sudo ln -s /home/<loginname>/magento/vendor/magento/vendor/magento/magento2-base /var/www/html/magento
    – BartZalas
    Nov 29, 2020 at 20:47
  • Changing to sudo ln -s /home/<loginname>/magento/vendor /var/www/html/magento did not solve this issue. I had to browse to magento/magento2-base in the browser and I still have the same error message. Nov 30, 2020 at 7:01
  • Again you added vendor, link all from Magento not only vendor
    – BartZalas
    Nov 30, 2020 at 11:08

1 Answer 1

0

I have chosen a different approach. I downloaded the tar.gz file, extracted it to \var\www\html\magento and run the installer.

It is not the easiest installation method.

Thanks for your help @BartZalas.

With kind regards, TheStingPilot

1
  • Please make sure to accept your own answer to close it! Dec 1, 2020 at 8:38

Your Answer

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

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