diff --git a/src/Composer/EventDispatcher/EventDispatcher.php b/src/Composer/EventDispatcher/EventDispatcher.php index 6f07bd397..1fcbb89af 100644 --- a/src/Composer/EventDispatcher/EventDispatcher.php +++ b/src/Composer/EventDispatcher/EventDispatcher.php @@ -571,7 +571,11 @@ class EventDispatcher private function ensureBinDirIsInPath(): void { $pathEnv = 'PATH'; - if (false === Platform::getEnv('PATH') && false !== Platform::getEnv('Path')) { + + // checking if only Path and not PATH is set then we probably need to update the Path env + // on Windows getenv is case-insensitive so we cannot check it via Platform::getEnv and + // we need to check in $_SERVER directly + if (!isset($_SERVER[$pathEnv]) && isset($_SERVER['Path'])) { $pathEnv = 'Path'; }