Problem
Using PHP SDK, Redis and Split Synchronizer setup, when SDK code calls getTreatment function, an exception occurred:
Fetching item ** SPLITIO.split.test ** from cache getTreatment method is throwing exceptions NOAUTH Authentication required.
Root cause
Redis instance requires authentication, the PHP code is missing the password parameter in the Redis configuration structure.
$options = ['prefix' => ''];
$sdkConfig = array(
'cache' => array('adapter' => 'predis',
'parameters' => $parameters,
'options' => $options
)
);
Solution
Since the Split PHP SDK uses predis library, we can add the password parameter to the configuration structure:
$options = [
'prefix' => '',
'parameters' => [
'password' => 'REDISPASSWORD'
],
];
$sdkConfig = array(
'cache' => array('adapter' => 'predis',
'parameters' => $parameters,
'options' => $options
)
);
Comments
0 comments
Please sign in to leave a comment.