I am getting the following error whenever I connect to Amazon Rekognition Service through a PHP script deployed on a hosted server (hostgator)

AWS HTTP error: Client error: POST https://rekognition.us-east-2.amazonaws.com resulted in a 400 Bad Request response: {"__type":"InvalidSignatureException","message":"Signature expired: 20190430T075732Z is now earlier than 20190430T105409 (truncated...) InvalidSignatureException (client): Signature expired: 20190430T075732Z is now earlier than 20190430T105409Z (20190430T105909Z - 5 min.) - {"__type":"InvalidSignatureException","message":"Signature expired: 20190430T075732Z is now earlier than 20190430T105409Z (20190430T105909Z - 5 min.)"}'

I am using the following PHP script.

require 'aws/aws-autoloader.php';
use Aws\Rekognition\RekognitionClient;
//Credentials for access AWS Service code parameter
$credentials = new Aws\Credentials\Credentials('xxxx', 'yyyyy');
//Get Rekognition Access
$rekognitionClient = RekognitionClient::factory(array(
'region' => "us-east-2",
'version' => 'latest',
'correctClockSkew' => true,
'credentials' => $credentials
));

I tried adding "'correctClockSkew' => true," as suggested by other solutions but doesnt seem to work for me.

I am not sure whether it is the right way of solving this problem.

Please Help

0 Answers