Showing results for 
Search instead for 
Did you mean: 

2.4.5 to 2.4.6 di:compile failure

2.4.5 to 2.4.6 di:compile failure

I'm running into the below.  This is part of my suffering 2.3.5 to 2.4.6 journey.


Any insight would be greatly appreciated as I'm down in production at the moment. Smiley Happy


[server_admin]:public_html$ bin/magento setup:di:compile

Compilation was started.

Application code generator... 3/9 [=========>------------------]  33% 6 secs 248.0 MiB

There is an error in /home/ at line: 14

Class "Zend\Mvc\Controller\AbstractActionController" not found#0 /home/ include()

#1 /home/ Composer\Autoload\{closure}()

#2 [internal function]: Composer\Autoload\ClassLoader->loadClass()

#3 /home/ class_exists()

#4 /home/ Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass()

#5 /home/ Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract()

#6 /home/ Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList()

#7 /home/ Magento\Setup\Module\Di\App\Task\Operation\ApplicationCodeGenerator->getFiles()

#8 /home/ Magento\Setup\Module\Di\App\Task\Operation\ApplicationCodeGenerator->doOperation()

#9 /home/ Magento\Setup\Module\Di\App\Task\Manager->process()

#10 /home/ Magento\Setup\Console\Command\DiCompileCommand->execute()

#11 /home/ Symfony\Component\Console\Command\Command->run()

#12 /home/ Symfony\Component\Console\Application->doRunCommand()

#13 /home/ Symfony\Component\Console\Application->doRun()

#14 /home/ Magento\Framework\Console\Cli->doRun()

#15 /home/ Symfony\Component\Console\Application->run()

#16 {main}


Re: 2.4.5 to 2.4.6 di:compile failure

It appears that the error occurs in:




The above class was probably missed by composer as part of your upgrade process, to force composer to pull down the latest version of this class, try removing the setup directory from the Magento root and then executing "composer install" again.

You may also want to consider removing the following directories from the Magento root directory:

  • setup
  • lib
  • vendor
  • dev

Afterwards, run your 'composer install' to allow the package manager to download the latest versions of the above mentioned directories.

Re: 2.4.5 to 2.4.6 di:compile failure



It seems like your compilation process has encountered an error. Without the specific error message, it's challenging to pinpoint the exact issue. However, here are some general steps you can take to troubleshoot and resolve the problem:

  1. Check Error Message: Look for the error message that follows the line "There is an error in" in your console output. This error message will provide more information about what went wrong during the compilation process.

  2. Review Code Changes: If you've recently made any changes to your Magento codebase, review those changes to see if there are any syntax errors or issues that could be causing the compilation error.

  3. Check File Permissions: Ensure that the files and directories in your Magento installation have the correct permissions. Improper file permissions can sometimes cause issues during the compilation process.

  4. Clear Cache: Clear Magento cache before running the compilation again. Sometimes, stale cache files can interfere with the compilation process.

  5. Check System Requirements: Ensure that your server meets the system requirements for running Magento. Check PHP version, required PHP extensions, memory limit, etc.

  6. Disable Compilation Mode: If you're unable to resolve the issue, you can temporarily disable the compilation mode by running the following command:

    bin/magento setup:di:compile --no-compile

    This will skip the compilation process and allow you to access your store. However, it's important to resolve the underlying issue and re-enable compilation mode for optimal performance.


    Once you have more information about the specific error message, you'll be better equipped to troubleshoot and resolve the compilation issue.
Manish Mittal

Re: 2.4.5 to 2.4.6 di:compile failure

Same issue, then I  create a new magento2 in another path and found that the path "setup" in  new installation do not have those files.

So rm -r setup, and copy paste. and it works.

This is simply a result of magento not removing outdated files.