I'm trying to make a fresh install of Magento 2.4.0. I want to say in advance I didn't have any problem at all in installing Magento 2.3.5 with PHP 7.3.20. Anyway...

Here's my config:

  • Debian 10
  • Apache 2.4.38
  • PHP 7.4.8
  • MariaDB 10.4.13
  • Composer 1.10.10

The installation process

  1. I tried either method: by uploading all files directly and by using Composer:

    composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento
  2. After that, I set the permissions:

    chmod 775 -R /var/www/magento && chown -R www-data:www-data /var/www/magento && cd /var/www/magento && find . var generated vendor pub/static pub/media app/etc app/code app/design -type f -exec chmod g+w {} + && find var generated vendor pub/static pub/media app/etc app/code app/design -type d -exec chmod g+ws {} + && chown -R :www-data . && chmod u+x bin/magento
  3. Then I run the installation command:

    magento setup:install --base-url=https://dev.example.com --db-host=localhost --db-name=magento --db-user=magento --db-password=mypassoword --admin-firstname=admin --admin-lastname=admin --admin-email=myuser@gmail.com --admin-user=admin --admin-password=mypassword --language=en_US --currency=USD --timezone=Europe/Rome --use-rewrites=1

    and I received some errors:

    Module 'Magento_ComposerRootUpdatePlugin':
    Installing data... Reading /<magento_root>/composer.json
    Loading config file /<magento_root>/composer.json
    Failed to initialize global composer: Composer could not find the config file: /<magento_root>/var/composer_home/composer.json
    To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section
  4. Then I tried to reach the frontend and I got this error:

    An error has happened during application run. See exception log for details.

    And this is the var/log/exception.log

    main.CRITICAL: Class Magento\Framework\App\Http\Interceptor does not exist {"exception":"[object] (ReflectionException(code: -1): Class Magento\\Framework\\App\\Http\\Interceptor does not exist at /var/www/magento/vendor/magento/framework/Code/Reader/ClassReader.php:26)"} []

What I tried

  • I tried to recompile, flush the cache, deploy...
  • I replaced MariaDB 10.4.13 with Mysql 8.0.21...

Any ideas?

  • your forth options error your run step wise commands like :- first of var/cache var/view_preprocessed , compile , setup:upgrade, deploy and cache , and last flush commands and try again Aug 7, 2020 at 3:24
  • run this command : sudo chmod -R 777 var/ generated/ pub/ Aug 7, 2020 at 4:39
  • @MohitPatel rm -rf var/di/* var/generation/* var/cache/* var/log/* var/page_cache/* && magento c:f && magento setup:upgrade && magento setup:di:compile && magento indexer:reindex && magento cache:disable full_page translate layout block_html && magento c:f then it throws a HTTP 500 Error.
    – KaMZaTa
    Aug 7, 2020 at 10:56
  • @DhirenVasoya Done, then it throws a HTTP 500 Error.
    – KaMZaTa
    Aug 7, 2020 at 10:57
  • I think permission issue apply permission and check Aug 7, 2020 at 13:31

2 Answers 2


At the end, with no little effort, I found out Magento 2.4.0 raised issues with my Nginx reverse proxy set in front of Apache and Varnish (until Magento 2.3.5-p2 it worked fine).

In order to solve this I had to increase the proxy buffer in this way (here some reference):

server {


    location / {


        proxy_buffers              128 8k;
        proxy_buffer_size          512k;
        proxy_busy_buffers_size    512k;



just put an empty JSON object into your global config.

echo "{}" > ~/.composer/composer.json

Next run all commands like upgrade, di,static-content, cache flush, permission

(OR) add public key and private key in the composer. you will get keys from magento account.

  • Thanks but why should I add an empty JSON object into the user composer global config (that, by the way, it doesn't exist)? What's the purpose? Furthermore, why should I also add the Magento credentials in the composer file? Anyway, as I wrote, the problem persists even uploading all files directly thus without using composer method.
    – KaMZaTa
    Aug 7, 2020 at 12:23
  • i got same issue so i have added composer so problem solved for me. some dependence modules install using with keys
    – P Ramulu
    Aug 7, 2020 at 12:26
  • Done but it didn't work. Since I'm using Debian I had to create ~/.config/composer/composer.json and add {} as you wrote. I also tried to add the Magento credentials but nothing's changed.
    – KaMZaTa
    Aug 7, 2020 at 12:43
  • How should I add public and private key in var/composer_home/composer.json file? Can you provide an example?
    – KaMZaTa
    Aug 11, 2020 at 12:00

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.