I upgraded a number of module but when I come to compile (bin/magento setup:di:compile) I get the error below. Anyone know how to fix it? Thank you Andy
Repositories code generation... 1/9 [===>------------------------] 11% < 1 sec 104.0 MiBCall to undefined function Composer\Autoload\includeFile()#0 /var/www/vhosts/mysite.co.uk/htdocs/public_html/vendor/composer/ClassLoader.php(578): include()
#1 /var/www/vhosts/mysite.co.uk/htdocs/public_html/vendor/composer/ClassLoader.php(432): Composer\Autoload\ClassLoader::Composer\Autoload\{closure}()
#2 [internal function]: Composer\Autoload\ClassLoader->loadClass()
#3 [internal function]: spl_autoload_call()
#4 /var/www/vhosts/mysite.co.uk/htdocs/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(134): class_exists()
#5 /var/www/vhosts/mysite.co.uk/htdocs/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(117): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->includeClass()
#6 /var/www/vhosts/mysite.co.uk/htdocs/public_html/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php(87): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->extract()
#7 /var/www/vhosts/mysite.co.uk/htdocs/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Operation/RepositoryGenerator.php(61): Magento\Setup\Module\Di\Code\Reader\ClassesScanner->getList()
#8 /var/www/vhosts/mysite.co.uk/htdocs/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(56): Magento\Setup\Module\Di\App\Task\Operation\RepositoryGenerator->doOperation()
#9 /var/www/vhosts/mysite.co.uk/htdocs/public_html/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(216): Magento\Setup\Module\Di\App\Task\Manager->process()
#10 /var/www/vhosts/mysite.co.uk/htdocs/public_html/vendor/symfony/console/Command/Command.php(255): Magento\Setup\Console\Command\DiCompileCommand->execute()
#11 /var/www/vhosts/mysite.co.uk/htdocs/public_html/vendor/symfony/console/Application.php(1021): Symfony\Component\Console\Command\Command->run()
#12 /var/www/vhosts/mysite.co.uk/htdocs/public_html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#13 /var/www/vhosts/mysite.co.uk/htdocs/public_html/vendor/magento/framework/Console/Cli.php(115): Symfony\Component\Console\Application->doRun()
#14 /var/www/vhosts/mysite.co.uk/htdocs/public_html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun()
#15 /var/www/vhosts/mysite.co.uk/htdocs/public_html/bin/magento(23): Symfony\Component\Console\Application->run()
#16 {main}
You have new mail in /var/spool/mail/mysite`
-bash-4.2$
Still struggling with this.
I found some advice to find which class is causing issues by adding echo "Class: ".$path."\n to the /setup/src/Magento/Setup/Module/Di/Code/Reader/ClassesScanner.php file.
Now I'm getting the below when running setup:di:compile
syntax error, unexpected '$realPath' (T_VARIABLE), expecting ';' or ','#0 /var/www/vhosts/mysite.co.uk/public_html/vendor/composer/ClassLoader.php(432): Composer\Autoload\ClassLoader::Composer\Autoload{closure}() #1 [internal function]: Composer\Autoload\ClassLoader->loadClass() #2 [internal function]: spl_autoload_call() #3 /var/www/vhosts/mysite.co.uk/public_html/vendor/magento/framework/Code/Reader/ClassReader.php(71): ReflectionClass->__construct() #4 /var/www/vhosts/mysite.co.uk/public_html/vendor/magento/framework/Code/Reader/ClassReader.php(36): Magento\Framework\Code\Reader\ClassReader->getParameterClass() #5 /var/www/vhosts/mysite.co.uk/public_html/vendor/magento/framework/ObjectManager/Definition/Runtime.php(54): Magento\Framework\Code\Reader\ClassReader->getConstructor() #6 /var/www/vhosts/mysite.co.uk/public_html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime->getParameters() #7 /var/www/vhosts/mysite.co.uk/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create() #8 /var/www/vhosts/mysite.co.uk/public_html/setup/src/Magento/Setup/Module/Di/App/Task/OperationFactory.php(109): Magento\Framework\ObjectManager\ObjectManager->create() #9 /var/www/vhosts/mysite.co.uk/public_html/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php(38): Magento\Setup\Module\Di\App\Task\OperationFactory->create() #10 /var/www/vhosts/mysite.co.uk/public_html/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php(189): Magento\Setup\Module\Di\App\Task\Manager->addOperation() #11 /var/www/vhosts/mysite.co.uk/public_html/vendor/symfony/console/Command/Command.php(255): Magento\Setup\Console\Command\DiCompileCommand->execute() #12 /var/www/vhosts/mysite.co.uk/public_html/vendor/symfony/console/Application.php(1021): Symfony\Component\Console\Command\Command->run() #13 /var/www/vhosts/mysite.co.uk/public_html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand() #14 /var/www/vhosts/mysite.co.uk/public_html/vendor/magento/framework/Console/Cli.php(115): Symfony\Component\Console\Application->doRun() #15 /var/www/vhosts/mysite.co.uk/public_html/vendor/symfony/console/Application.php(149): Magento\Framework\Console\Cli->doRun() #16 /var/www/vhosts/mysite.co.uk/public_html/bin/magento(23): Symfony\Component\Console\Application->run()
Line 432 of the /var/www/vhosts/mysite.co.uk/public_html/vendor/composer/ClassLoader.php(432): Is (self::$includeFile)($file);
Tu Van I did try removing the vendor folder but this didn't work either. Hope someone can advise. Andy
vendor
directory and runcomposer install
.