0

I updated magento to 2.4.6 and PHP 8.2 and When I run any comment in Magento (i.e php bin/magento cache:flush or php bin/magento cache:clean) I get this error on the console:

There is an error in /var/www/magento2/vendor/magento/framework/App/ErrorHandler.php at line: 62
Deprecated Functionality: Using ${var} in strings is deprecated, use {$var} instead in /var/www/magento2/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php on line 777#0 /var/www/magento2/vendor/composer/ClassLoader.php(582): Magento\Framework\App\ErrorHandler->handler()
#1 /var/www/magento2/vendor/composer/ClassLoader.php(582): include()
#2 /var/www/magento2/vendor/composer/ClassLoader.php(433): Composer\Autoload\{closure}()
#3 /var/www/magento2/vendor/composer/composer/src/Composer/Factory.php(384): Composer\Autoload\ClassLoader->loadClass()
#4 /var/www/magento2/vendor/composer/composer/src/Composer/Factory.php(595): Composer\Factory->createComposer()
#5 /var/www/magento2/vendor/magento/framework/Composer/ComposerFactory.php(45): Composer\Factory::create()
#6 /var/www/magento2/vendor/magento/framework/Composer/ComposerInformation.php(368): Magento\Framework\Composer\ComposerFactory->create()
#7 /var/www/magento2/vendor/magento/framework/Composer/ComposerInformation.php(381): Magento\Framework\Composer\ComposerInformation->getComposer()
#8 /var/www/magento2/vendor/magento/framework/Composer/ComposerInformation.php(244): Magento\Framework\Composer\ComposerInformation->getLocker()
#9 /var/www/magento2/vendor/magento/framework/App/ProductMetadata.php(120): Magento\Framework\Composer\ComposerInformation->getSystemPackages()
#10 /var/www/magento2/vendor/magento/framework/App/ProductMetadata.php(80): Magento\Framework\App\ProductMetadata->getSystemPackageVersion()
#11 /var/www/magento2/vendor/magento/framework/Console/Cli.php(99): Magento\Framework\App\ProductMetadata->getVersion()
#12 /var/www/magento2/bin/magento(22): Magento\Framework\Console\Cli->__construct()
#13 {main}

any suggestions?

4 Answers 4

1

Please use PHP 8.1 for the Magento2.4.6

PHP 8.2 support Magento 2.4.6 but not tested.

0

Somehow the file AutoloadGenerator.php was not updated. As the message mentioned there was an issue with this file which was not compatible with PHP 8.2.

I modified the file accordingly and I do not see any errors.

0

vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php:

780 $issues = array();

781 $issues = array();

782: ${requiredPhp}${requiredExtensions}

782 if ($issues) {

783 if ($issues) {

you get like this on line 782 change that line to -> {$requiredPhp}{$requiredExtensions}

0

You can remove the depreciated functionality message by editing the bootstrap.php file and changing the error reporting to:-

error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT);

I had the same problems with the install. These are still only warnings, not errors and stops them appearing especially when modules haven't updated their compatibility to 8.2 yet.

Your Answer

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

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