Magento2 Deprecated Functionality – The each() Function is Deprecated

magento2

I have installed magento 2.2.6 version in php 7.2. After the installation i tried to run the cache clear commands. But there was an error thrown called,

Deprecated Functionality: The each() function is deprecated. This message will be suppressed on further calls in /var/www/html/xxxxxxxx.com/vendor/magento/zendframework1/library/Zend/Cache/Backend.php on line 79

After i downgraded my php version from 7.2 to 7.0 i've done all the required things, disabled 7.2 and enabled 7.0, when i run info.php it showing the right version. But still the same issue is happening. I don't know where is the problem kindly help me to fix this.

Note: in terminal when i run php -v it showing php 7.2. Thanks in advance

Best Answer

when you are running command line it will take php-cli configurations instead of php-fpm. if you installed both php7.0,php7.2 use following commands for clearing cache

Instead of running php bin/magento cache:clean run php7.0 bin/magento cache:clean

Related Topic