{"record":{"id":"3b33ef457a7c40fd","repo":"phpmyadmin/phpmyadmin","slug":"no-uri-factories-found","errorCode":null,"errorMessage":"No URI factories found.","messagePattern":"No URI factories found\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"src/Http/Factory/UriFactory.php","lineNumber":62,"sourceCode":"    public function __construct(private UriFactoryInterface $uriFactory)\n    {\n    }\n\n    public function createUri(string $uri = ''): UriInterface\n    {\n        return $this->uriFactory->createUri($uri);\n    }\n\n    /** @throws RuntimeException When no {@see UriFactoryInterface} implementation is found. */\n    public static function create(): self\n    {\n        foreach (self::$providers as $provider) {\n            if (class_exists($provider)) {\n                return new self(new $provider());\n            }\n        }\n\n        throw new RuntimeException('No URI factories found.');\n    }\n\n    /**\n     * Create new Uri from environment.\n     *\n     * Initially based on the \\Slim\\Psr7\\Factory\\UriFactory::createFromGlobals() implementation.\n     *\n     * @param mixed[] $server\n     */\n    public function fromGlobals(array $server): UriInterface\n    {\n        $uri = $this->createUri();\n\n        $uri = $uri->withScheme(! isset($server['HTTPS']) || $server['HTTPS'] === 'off' ? 'http' : 'https');\n\n        if (isset($server['PHP_AUTH_USER']) && is_string($server['PHP_AUTH_USER']) && $server['PHP_AUTH_USER'] !== '') {\n            $uri = $uri->withUserInfo(\n                $server['PHP_AUTH_USER'],","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/phpmyadmin/phpmyadmin/blob/70d713dc39f5f7e0683c0ee38ab816b7e72b6a49/src/Http/Factory/UriFactory.php#L44-L80","documentation":"UriFactory::create() iterates its static list of PSR-17 URI factory provider classes and returns the first available implementation. If none of the known provider classes exists in the autoloaded environment, phpMyAdmin has no way to build PSR-7 URIs and throws this RuntimeException.","triggerScenarios":"Calling UriFactory::create() (directly or via run, fromGlobalsUri and related flows, tests) when every class in self::$providers fails class_exists() — i.e. no PSR-7/PSR-17 implementation package is installed or autoloadable.","commonSituations":"Fresh checkout without composer install; stripped production image missing slim/psr7 or nyholm/psr7; custom autoloader excluding vendor PSR-17 packages; version upgrade that dropped the previously bundled HTTP implementation.","solutions":["Install a PSR-17 implementation providing a URI factory: composer require slim/psr7 or nyholm/psr7.","Run composer install / dump-autoload and confirm vendor/autoload.php is required in the entry point.","Verify with class_exists() which provider from self::$providers the environment should supply and install that package at a supported version.","If deploying a minimal build, include at least one supported PSR-17 implementation in the dependency tree."],"exampleFix":"// before\n$uriFactory = UriFactory::create(); // RuntimeException: No URI factories found.\n\n// after\n// shell: composer require nyholm/psr7\nif (!class_exists(\\Nyholm\\Psr7\\Factory\\UriFactory::class)) {\n    throw new \\RuntimeException('Install a PSR-17 implementation, e.g. composer require nyholm/psr7');\n}\n$uriFactory = UriFactory::create();","handlingStrategy":"validation","validationCode":"// before building URIs\n$providers = ['Slim\\Psr7\\Factory\\UriFactory', 'Nyholm\\Psr7\\Factory\\UriFactory', /* ... factory's list */];\n$found = false;\nforeach ($providers as $p) {\n    if (class_exists($p)) { $found = true; break; }\n}\nif (!$found) {\n    throw new RuntimeException('Install a PSR-17 URI factory: composer require nyholm/psr7');\n}","typeGuard":"function hasPsr17UriFactory(): bool\n{\n    foreach (['Slim\\Psr7\\Factory\\UriFactory', 'Nyholm\\Psr7\\Factory\\UriFactory'] as $p) {\n        if (class_exists($p)) {\n            return true;\n        }\n    }\n    return false;\n}","tryCatchPattern":"try {\n    $uriFactory = UriFactory::create();\n} catch (RuntimeException $e) {\n    if (str_contains($e->getMessage(), 'No URI factories found')) {\n        // guide operator to: composer require slim/psr7 or nyholm/psr7\n    }\n    throw $e;\n}","preventionTips":["Declare a PSR-17 implementation package directly in composer.json.","Run composer install and composer dump-autoload after every deployment.","Include a dependency health check that class_exists()s the URI factory providers.","Avoid stripping vendor packages individually; rely on composer's dependency resolution."],"tags":["psr-7","psr-17","dependency-missing","uri"],"backgroundTag":"missing-dependency","analyzedSha":"70d713dc39f5f7e0683c0ee38ab816b7e72b6a49","analyzedAt":"2026-09-13T19:13:03.620Z","contentChangedAt":"2026-09-13T19:13:03.620Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}