colinmollenhour / Cm_RedisSession

Redis-based session handler for Magento with optimistic locking
208 stars 121 forks source link

Passing glue string after array is deprecated. Swap the parameters in colinmollenhour/credis/Client.php on line 1414 #172

Closed MountainX closed 4 years ago

MountainX commented 4 years ago

Magento 2 is failing to start. The logs show this error:

Deprecated Functionality: implode(): Passing glue string after array is deprecated. Swap the parameters in vendor/colinmollenhour/credis/Client.php on line 1414

I have a standard Redis installation. There is no custom code in the site. Redis was installed in the usual way according to these Magento Dev Docs.

Here's the code referenced by the error message:

   1406     /**
   1407      * Build the Redis unified protocol command
   1408      *
   1409      * @param array $args
   1410      * @return string
   1411      */
   1412     private static function _prepare_command($args)
   1413     {
   1414         return sprintf('*%d%s%s%s', count($args), CRLF, implode(array_map(array('self', '_map'), $args), CRLF), CRLF);
   1415     }

Has anyone run into this error yet? Is there a solution (other than disabling Redis)?

Version info:

colinmollenhour commented 4 years ago

This is related to running PHP 7.4. It was fixed here: https://github.com/colinmollenhour/credis/pull/131 I just tagged it as 1.11.1

Magento2 will need to pull in the latest version.

kirkmadera commented 4 years ago

Confirmed that this no longer occurs in Magento 2.4.0 on PHP 7.4 which was just GA released today

moni921 commented 4 years ago

I have magento 2.4 setup and getting above issue with php 7.4. Please help

kirkmadera commented 4 years ago

If you upgraded from <7.4, you might try manually clearing redis.

redis-cli flushall

or

telnet localhost 6379
flushall