yii\redis\Session does not work with PHP 7.0.1

I had a strange error 500 problem with no logs in apache today. Happened in PHP 7.0.1, worked in PHP 5.6.16. I found that the redis session component was the issue, I had to remove




'session' => [

	    'class' => 'yii\redis\Session',

	    'redis' => [

	    	'hostname' => 'localhost',

		'port' => 6379,

		'database' => 0,

	    ],

	],



from my config/web.php

Since there are no error messages, I cannot really find out why this stopped working.

Check logs in runtime dir of your application.

I checked the runtime/logs/app.log, unfortunately nothing recorded. Strangely I don’t get the usual yii debug output in the browser, only a generic 500 error.

What’s your YII_DEBUG value in index.php?

defined(‘YII_DEBUG’) or define(‘YII_DEBUG’, true);

That’s weird. Yii Redis has tests https://github.com/yiisoft/yii2-redis/tree/master/tests and these are passing on PHP 7.

Hi, I have the same problem. php 7.0.2, yii 2.0.6, redis 3.0.6. 500 error but nothing in any of the logs.

Redis cache seems to work fine btw, just session that’s causing the problem.