Closed JasonSanYe closed 2 years ago
Please write in English.
Can you show your $sessionSavePath
value in Config\App
?
I also having this problem while testing with redis. Im using .env with app.sessionSavePath = 'tcp://127.0.0.1:6379'
with php8.1.
on php7.4 no ErrorException
@hurtsky Try:
--- a/system/Session/Handlers/RedisHandler.php
+++ b/system/Session/Handlers/RedisHandler.php
@@ -78,7 +78,7 @@ class RedisHandler extends BaseHandler
'port' => empty($matches[2]) ? null : $matches[2],
'password' => preg_match('#auth=([^\s&]+)#', $matches[3], $match) ? $match[1] : null,
'database' => preg_match('#database=(\d+)#', $matches[3], $match) ? (int) $match[1] : null,
- 'timeout' => preg_match('#timeout=(\d+\.\d+)#', $matches[3], $match) ? (float) $match[1] : null,
+ 'timeout' => preg_match('#timeout=(\d+\.\d+)#', $matches[3], $match) ? (float) $match[1] : 0.0,
];
preg_match('#prefix=([^\s&]+)#', $matches[3], $match) && $this->keyPrefix = $match[1];
PHP Version
8.1
CodeIgniter4 Version
4.2.6
CodeIgniter4 Installation Method
Composer (as dependency to an existing project)
Which operating systems have you tested for this bug?
macOS
Which server did you use?
fpm-fcgi
Database
No response
What happened?
将session 设置redis
php7.4正常
php8.1报错:Redis::connect(): Passing null to parameter #3 ($timeout) of type float is deprecated
Steps to Reproduce
将session 设置redis
php8.1 下
Expected Output
将session 设置redis
php8.1 下
Anything else?
No response