2

I'm getting this as an error after installing magento via bitnami xammp.

Deprecated: The each() function is deprecated. This message will be suppressed on further calls in C:\xampp\apps\magento\htdocs\vendor\colinmollenhour\cache-backend-file\File.php on line 81 There has been an error processing your request Exception printing is disabled by default for security reasons. Error log record number: 1638419606

What should I do now?

M. Eriksson
  • 13,450
  • 4
  • 29
  • 40
Taha Dalvi
  • 33
  • 1
  • 3
  • The function `each()` was deprecated in PHP 7.2. Are you using the latest version of Magento? Is your Magento version support your PHP version? Is it a plugin? Does that plugin support your PHP version? Is there a newer version of that plugin? If you really can't affect any of that, then you could change the error reporting level: http://php.net/manual/en/function.error-reporting.php (however, that's not as much a "solution" as it is a workaround). – M. Eriksson Feb 26 '18 at 22:21
  • Yes. I'm using magento 2.2. And my version is PHP/7.2.1 and it is no where documented on the magento 2 system requirement,its just says that it support 7.1.x. – Taha Dalvi Feb 26 '18 at 22:24
  • A quick google would have given you the answer: https://magento.stackexchange.com/questions/205087/magento-2-2-is-not-working-in-php-7-2-0 (that's just one of many posts about issues with Magento 2.2 with PHP 7.2). – M. Eriksson Feb 26 '18 at 22:30
  • @MagnusEriksson Thank you. – Taha Dalvi Feb 26 '18 at 22:55

3 Answers3

3

This is probably because you use php 7.2 which Magento doesn't support currently, even in 2.3 pre-release. You can downgrade to php 7.1.X and use Magento 2.2.X or downgrade to php 7.0.7.X and use Magento 2.1.X.

More information about Magento versions and its php support here.

NanoPish
  • 1,379
  • 1
  • 19
  • 35
0

i fixed this error by changing my php version in wamp down from 7.2 to 7.1 and the error went away and now i'm able to install.

Sebastian
  • 402
  • 3
  • 12
0

Change

while (list($name, $value) = each($options)) {
   $this->setOption($name, $value);
}

To

foreach ($options as $name => $value){
   $this->setOption($name, $value);
}

Reference in: https://community.magento.com/t5/Installing-Magento-2-x/Deprecated-The-each-function-is-deprecated/td-p/80126