phpmyadmin/phpmyadmin · critical · RuntimeException
No URI factories found.
Error message
No URI factories found.
What it means
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.
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.
Example fix
// before
$uriFactory = UriFactory::create(); // RuntimeException: No URI factories found.
// after
// shell: composer require nyholm/psr7
if (!class_exists(\Nyholm\Psr7\Factory\UriFactory::class)) {
throw new \RuntimeException('Install a PSR-17 implementation, e.g. composer require nyholm/psr7');
}
$uriFactory = UriFactory::create(); Defensive patterns
Strategy: validation
Validate before calling
// before building URIs
$providers = ['Slim\Psr7\Factory\UriFactory', 'Nyholm\Psr7\Factory\UriFactory', /* ... factory's list */];
$found = false;
foreach ($providers as $p) {
if (class_exists($p)) { $found = true; break; }
}
if (!$found) {
throw new RuntimeException('Install a PSR-17 URI factory: composer require nyholm/psr7');
} Type guard
function hasPsr17UriFactory(): bool
{
foreach (['Slim\Psr7\Factory\UriFactory', 'Nyholm\Psr7\Factory\UriFactory'] as $p) {
if (class_exists($p)) {
return true;
}
}
return false;
} Try / catch
try {
$uriFactory = UriFactory::create();
} catch (RuntimeException $e) {
if (str_contains($e->getMessage(), 'No URI factories found')) {
// guide operator to: composer require slim/psr7 or nyholm/psr7
}
throw $e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Understand the failure class
Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.
Related errors
AI-assisted analysis of phpmyadmin/phpmyadmin@70d713dc39 (2026-09-13).
Data as JSON: /api/errors/3b33ef457a7c40fd.
Report an issue: GitHub.
Appendix: source
Thrown at src/Http/Factory/UriFactory.php:62
public function __construct(private UriFactoryInterface $uriFactory)
{
}
public function createUri(string $uri = ''): UriInterface
{
return $this->uriFactory->createUri($uri);
}
/** @throws RuntimeException When no {@see UriFactoryInterface} implementation is found. */
public static function create(): self
{
foreach (self::$providers as $provider) {
if (class_exists($provider)) {
return new self(new $provider());
}
}
throw new RuntimeException('No URI factories found.');
}
/**
* Create new Uri from environment.
*
* Initially based on the \Slim\Psr7\Factory\UriFactory::createFromGlobals() implementation.
*
* @param mixed[] $server
*/
public function fromGlobals(array $server): UriInterface
{
$uri = $this->createUri();
$uri = $uri->withScheme(! isset($server['HTTPS']) || $server['HTTPS'] === 'off' ? 'http' : 'https');
if (isset($server['PHP_AUTH_USER']) && is_string($server['PHP_AUTH_USER']) && $server['PHP_AUTH_USER'] !== '') {
$uri = $uri->withUserInfo(
$server['PHP_AUTH_USER'],View on GitHub (pinned to 70d713dc39)