NOTE: This repository is part of Google Cloud PHP. Any
support requests, bug reports, or development contributions should be directed to
that project.
A fully managed Redis service for the Google Cloud Platform. Applications running on Google Cloud Platform can achieve
extreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments.
Installation
To begin, install the preferred dependency manager for PHP, Composer.
Now install this component:
$ composer require google/cloud-redis
This component requires the gRPC extension. Please see our gRPC installation guide
for more information on how to configure the extension.
Authentication
Please see our Authentication guide for more information
on authenticating your client. Once authenticated, you'll be ready to start making requests.
Sample
require 'vendor/autoload.php';
use Google\Cloud\Redis\V1\CloudRedisClient;
$client = new CloudRedisClient();
$projectId = '[MY_PROJECT_ID]';
$location = '-'; // The '-' wildcard refers to all regions available to the project for the listInstances method
$formattedLocationName = $client->locationName($projectId, $location);
$response = $client->listInstances($formattedLocationName);
foreach ($response->iterateAllElements() as $instance) {
printf('Instance: %s : %s' . PHP_EOL,
$instance->getDisplayName(),
$instance->getName()
);
}
Debugging
Please see our Debugging guide
for more information about the debugging tools.
Version
This component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in
any minor or patch releases. We will address issues and requests with the highest priority.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["Version latestkeyboard_arrow_down\n\n- [2.1.6 (latest)](/php/docs/reference/cloud-redis/latest)\n- [2.1.5](/php/docs/reference/cloud-redis/2.1.5)\n- [2.0.0](/php/docs/reference/cloud-redis/2.0.0)\n- [1.9.5](/php/docs/reference/cloud-redis/1.9.5)\n- [1.8.4](/php/docs/reference/cloud-redis/1.8.4)\n- [1.7.0](/php/docs/reference/cloud-redis/1.7.0)\n- [1.6.12](/php/docs/reference/cloud-redis/1.6.12) \n\nGoogle Cloud Redis for PHP\n==========================\n\n\u003e Idiomatic PHP client for [Google Cloud Redis](https://cloud.google.com/memorystore/).\n\n[](https://packagist.org/packages/google/cloud-redis) [](https://packagist.org/packages/google/cloud-redis)\n\n**NOTE:** This repository is part of [Google Cloud PHP](https://github.com/googleapis/google-cloud-php). Any\nsupport requests, bug reports, or development contributions should be directed to\nthat project.\n\nA fully managed Redis service for the Google Cloud Platform. Applications running on Google Cloud Platform can achieve\nextreme performance by leveraging the highly scalable, available, secure Redis service without the burden of managing complex Redis deployments.\n\n### Installation\n\nTo begin, install the preferred dependency manager for PHP, [Composer](https://getcomposer.org/).\n\nNow install this component: \n\n $ composer require google/cloud-redis\n\nThis component requires the gRPC extension. Please see our [gRPC installation guide](https://cloud.google.com/php/grpc)\nfor more information on how to configure the extension.\n\n### Authentication\n\nPlease see our [Authentication guide](https://github.com/googleapis/google-cloud-php/blob/main/AUTHENTICATION.md) for more information\non authenticating your client. Once authenticated, you'll be ready to start making requests.\n\n### Sample\n\n require 'vendor/autoload.php';\n\n use Google\\Cloud\\Redis\\V1\\CloudRedisClient;\n\n $client = new CloudRedisClient();\n\n $projectId = '[MY_PROJECT_ID]';\n $location = '-'; // The '-' wildcard refers to all regions available to the project for the listInstances method\n $formattedLocationName = $client-\u003elocationName($projectId, $location);\n $response = $client-\u003elistInstances($formattedLocationName);\n foreach ($response-\u003eiterateAllElements() as $instance) {\n printf('Instance: %s : %s' . PHP_EOL,\n $instance-\u003egetDisplayName(),\n $instance-\u003egetName()\n );\n }\n\n### Debugging\n\nPlease see our [Debugging guide](https://github.com/googleapis/google-cloud-php/blob/main/DEBUG.md)\nfor more information about the debugging tools.\n\n### Version\n\nThis component is considered GA (generally available). As such, it will not introduce backwards-incompatible changes in\nany minor or patch releases. We will address issues and requests with the highest priority.\n\n### Next Steps\n\nTake a look at and understand the [official documentation](https://cloud.google.com/memorystore/docs/)."]]