Magento 2.4.0 – Installation Failure Troubleshooting

installationmagento2.4

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?

Best Answer

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_pass  http://192.168.1.100;

        ...

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

    ...

}
Related Topic