diff --git a/src/Credentials/EcsCredentialProvider.php b/src/Credentials/EcsCredentialProvider.php
index <HASH>..<HASH> 100644
--- a/src/Credentials/EcsCredentialProvider.php
+++ b/src/Credentials/EcsCredentialProvider.php
@@ -85,6 +85,11 @@ class EcsCredentialProvider
     private function getEcsUri()
     {
         $credsUri = getenv(self::ENV_URI);
+
+        if ($credsUri === false) {
+            $credsUri = isset($_SERVER[self::ENV_URI]) ? $_SERVER[self::ENV_URI] : '';
+        }
+        
         return self::SERVER_URI . $credsUri;
     }
 
diff --git a/tests/Credentials/EcsCredentialProviderTest.php b/tests/Credentials/EcsCredentialProviderTest.php
index <HASH>..<HASH> 100644
--- a/tests/Credentials/EcsCredentialProviderTest.php
+++ b/tests/Credentials/EcsCredentialProviderTest.php
@@ -20,6 +20,7 @@ class EcsCredentialProviderTest extends TestCase
     private function clearEnv()
     {
         putenv(EcsCredentialProvider::ENV_URI . '=');
+        unset($_SERVER[EcsCredentialProvider::ENV_URI]);
     }
 
     public function setUp()
redo missed getenv change (#<I>)