0

Hola buenas tardes estoy usando el SDK de aws y php pero me sale un error y no se como resolverlo agradecería mucho su ayuda gracias de antemano.

require '../../vendor/autoload.php';
use Aws\Rekognition\RekognitionClient;

$credentials = new Aws\Credentials\Credentials('*******', '******');

$rekognitionClient = RekognitionClient::factory(array(
        'region'    => 'us-east-2',
        'version'   => 'latest',
    'credentials' => $credentials,
    //'debug' => true, 
));

$compareFaceResults= $rekognitionClient->compareFaces([
    'SimilarityThreshold' => 80,
    'SourceImage' => [
        'Bytes' => file_get_contents("test.jpg")
    ],
    'TargetImage' => [
        'Bytes' => file_get_contents("test1.jpg")
    ],
]);

 $FaceMatchesResult = $compareFaceResults['FaceMatches'];
 $SimilarityResult =  $FaceMatchesResult['Similarity']; //Here You will get similarity
 $sourceImageFace = $compareFaceResults['SourceImageFace'];
 $sourceConfidence = $sourceImageFace['Confidence']; //Here You will get confidence of the picture

'Error retrieving credentials from the instance profile metadata server. (cURL error 28: Connection timed out after 1000 milliseconds (see http://curl.haxx.se/libcurl/c/libcurl-errors.html))' in C:\xampp\vendor\aws\aws-sdk-php\src\Credentials\InstanceProfileProvider.php:88 Stack trace: #0 C:\xampp\vendor\guzzlehttp\promises\src\Promise.php(203): Aws\Credentials\InstanceProfileProvider->Aws\Credentials{closure}(Array) #1 C:\xampp\vendor\guzzlehttp\promises\src\Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(2, Array, Array) #2 C:\xampp\vendor\guzzlehttp\promises\src\TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}() #3 C:\xampp\vendor\guzzlehttp\guzzle\src\Handler\CurlMultiHandler.php(98): GuzzleHttp\Promise\TaskQueue->run() #4 C:\xampp\vendor\guzzlehttp\guzzle\src\Handler\CurlMultiHandler.php(125): GuzzleHttp\Handler\CurlMultiHandler->tick() #5 C:\xampp\vendor\guzzlehttp\promises\src\Promise.php(246): Gu in C:\xampp\vendor\aws\aws-sdk-php\src\Credentials\InstanceProfileProvider.php on line 88

1 respuesta 1

0

Al parecer es un problema de conexión, Tienes algún proxy?.

Intenta modificando los parametros del Curl que usa tu librería de Guzzle para que no te vote timeout

curl_setopt($curl, CURLOPT_TIMEOUT,0);

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge you have read our privacy policy.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.