Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yii2-redis,$redis->eval() error #16613

Closed
alu12138 opened this issue Aug 6, 2018 · 8 comments
Closed

yii2-redis,$redis->eval() error #16613

alu12138 opened this issue Aug 6, 2018 · 8 comments

Comments

@alu12138
Copy link

alu12138 commented Aug 6, 2018

What steps will reproduce the problem?

$redis = \Yii::$app->redis;
$redis->eval($lua, array("data1", "date2", 1, 1,time()), 2);

What is the expected result?

Executed successfully

What do you get instead?

{
"name": "PHP Warning",
"message": "mb_strlen() expects parameter 1 to be string, array given",
"code": 2,
"type": "yii\base\ErrorException",
"file": "/vendor/yiisoft/yii2-redis/src/Connection.php",
"line": 677,
"stack-trace": [
"#0 [internal function]: yii\base\ErrorHandler->handleError(2, 'mb_strlen() exp...', '/vendor...', 677, Array)",
"#1 /vendor/yiisoft/yii2-redis/src/Connection.php(677): mb_strlen(Array, '8bit')",
"#2 /vendor/yiisoft/yii2-redis/src/Connection.php(630): yii\redis\Connection->executeCommand('EVAL', Array)",
"#3 /frontend/controllers/v1/MessageController.php(322): yii\redis\Connection->__call('eval', Array)",
"#4 /frontend/controllers/v1/MessageController.php(322): yii\redis\Connection->eval('\r\nlocal data...', Array, 4)",
"#5 [internal function]: frontend\controllers\v1\MessageController->actionOpen()",
"#6 /vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)",
"#7 /vendor/yiisoft/yii2/base/Controller.php(157): yii\base\InlineAction->runWithParams(Array)",
"#8 /vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('open', Array)",
"#9 /vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('v1/message/open', Array)",
"#10 /vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))",
"#11 /frontend/web/index.php(17): yii\base\Application->run()",
"#12 {main}"
]
}

Additional info

Q A
Yii version ~2.0.6
PHP version 5.6
Operating system centos
@alex-code
Copy link
Contributor

Can you update to the latest version, 2.0.6 is 3 years old!

@alu12138
Copy link
Author

alu12138 commented Aug 6, 2018

sorry,now 2.0.15.1

@alex-code
Copy link
Contributor

Do you still get an error with the latest version?

@alu12138
Copy link
Author

alu12138 commented Aug 6, 2018

yes,I wrote the wrong version number.
var_dump(\Yii::getVersion());
result 2.0.15.1

@alu12138
Copy link
Author

alu12138 commented Aug 6, 2018

Can I speak Chinese?

@alex-code
Copy link
Contributor

Ok, do you know what version of the redis component you have?
Can look in your composer.lock file.

@alu12138
Copy link
Author

alu12138 commented Aug 6, 2018

composer - 副本.zip

@yii-bot
Copy link

yii-bot commented Aug 6, 2018

Issue moved to yiisoft/yii2-redis#159

@yii-bot yii-bot closed this as completed Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants