{"record":{"id":"0d6e688cb304e4d7","repo":"composer/composer","slug":"you-are-on-an-old-windows-old-php-combo-which-do","errorCode":null,"errorMessage":"You are on an old Windows / old PHP combo which does not allow Composer to use junctions/symlinks and this path repository has symlink:true in its options so copying is not allowed","messagePattern":"You are on an old Windows / old PHP combo which does not allow Composer to use junctions/symlinks and this path repository has symlink:true in its options so copying is not allowed","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/Composer/Downloader/PathDownloader.php","lineNumber":299,"sourceCode":"        $mirrorPathRepos = Platform::getEnv('COMPOSER_MIRROR_PATH_REPOS');\n        if ((bool) $mirrorPathRepos) {\n            $currentStrategy = self::STRATEGY_MIRROR;\n        }\n\n        $symlinkOption = $transportOptions['symlink'] ?? null;\n\n        if (true === $symlinkOption) {\n            $currentStrategy = self::STRATEGY_SYMLINK;\n            $allowedStrategies = [self::STRATEGY_SYMLINK];\n        } elseif (false === $symlinkOption) {\n            $currentStrategy = self::STRATEGY_MIRROR;\n            $allowedStrategies = [self::STRATEGY_MIRROR];\n        }\n\n        // Check we can use junctions safely if we are on Windows\n        if (Platform::isWindows() && self::STRATEGY_SYMLINK === $currentStrategy && !$this->safeJunctions()) {\n            if (!in_array(self::STRATEGY_MIRROR, $allowedStrategies, true)) {\n                throw new \\RuntimeException('You are on an old Windows / old PHP combo which does not allow Composer to use junctions/symlinks and this path repository has symlink:true in its options so copying is not allowed');\n            }\n            $currentStrategy = self::STRATEGY_MIRROR;\n            $allowedStrategies = [self::STRATEGY_MIRROR];\n        }\n\n        // Check we can use symlink() otherwise\n        if (!Platform::isWindows() && self::STRATEGY_SYMLINK === $currentStrategy && !function_exists('symlink')) {\n            if (!in_array(self::STRATEGY_MIRROR, $allowedStrategies, true)) {\n                throw new \\RuntimeException('Your PHP has the symlink() function disabled which does not allow Composer to use symlinks and this path repository has symlink:true in its options so copying is not allowed');\n            }\n            $currentStrategy = self::STRATEGY_MIRROR;\n            $allowedStrategies = [self::STRATEGY_MIRROR];\n        }\n\n        return [$currentStrategy, $allowedStrategies];\n    }\n\n    /**","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/composer/composer/blob/6ffc1177404d0c50119c22dde6564a380f4a82c9/src/Composer/Downloader/PathDownloader.php#L281-L317","documentation":"Thrown by PathDownloader::computeAllowedStrategies() (line 297-303) on Windows when the symlink strategy is selected but safeJunctions() returns false. safeJunctions() requires proc_open and Windows >= 7 (version 6.1) due to a PHP bug (bugs.php.net/77552) that makes junction removal data-loss-prone on older combos. If mirror is not an allowed fallback (symlink:true forced), it throws.","triggerScenarios":"Platform::isWindows() is true, STRATEGY_SYMLINK is current, safeJunctions() is false (Windows < 7 or PHP < 7.2.16/7.3.3), and symlink:true in transport options excludes mirroring.","commonSituations":"Running Composer on an old Windows Server / old PHP where junctions are unsafe, while a path repo forces symlink:true.","solutions":["Upgrade PHP to 7.2.16+ or 7.3.3+ so junctions are safe","Upgrade to Windows 7 (6.1) or newer","Remove the symlink:true option so Composer can mirror instead of junction"],"exampleFix":"// before\n\"options\":{\"symlink\":true}\n// after (allows mirror fallback on old Windows/PHP)\n\"options\":{\"symlink\":null}","handlingStrategy":"validation","validationCode":"// On old Windows/PHP, do not force symlink-only\n$options = $package->getTransportOptions();\nif (PHP_OS_FAMILY === 'Windows' && PHP_VERSION_ID < 70216 && ($options['symlink'] ?? null) === true) {\n    $options['symlink'] = null; // allow mirror fallback\n    $package->setTransportOptions($options);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Upgrade PHP to 7.2.16+/7.3.3+ on Windows for safe junctions","Do not set symlink:true on old Windows/PHP combos; allow mirroring","Document platform requirements when distributing composer configs that force symlinks"],"tags":["path-repository","windows","php-version","symlink","junction"],"analyzedSha":"6ffc1177404d0c50119c22dde6564a380f4a82c9","analyzedAt":"2026-08-07T00:01:08.491Z","schemaVersion":2},"datasetVersion":"2026-08-07T02:17:10.218Z"}