Overview
Strengths
Use Cases
Product Series
Performance
Command Compatibility
Regions and AZs
Relevant Concepts
Relevant Products
<?php/**Enter your Tendis instance private IP, port number, instance ID, and password in the following parameters*/$host = "192.xx.xx.2";$port = 6379;$pwd = "123tj6na";$redis = new Redis();// Connect to the Tendis instanceif ($redis->connect($host, $port) == false) {die($redis->getLastError());}// Authenticateif ($redis->auth($pwd) == false) {die($redis->getLastError());}/**You can start manipulating the Tendis instance. For more information, please visit https://github.com/phpredis/phpredis. */// Set the keyif ($redis->set("redis", "tencent") == false) {die($redis->getLastError());}echo "set key redis suc, value is:tencent\\n";// Get the key$value = $redis->get("redis");echo "get key redis is:".$value."\\n";?>

Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback