# thephpleague/uri

[READ-ONLY] URI manipulation Library

Repository: https://github.com/thephpleague/uri
Canonical: https://ross.abutalabs.com/products/uri
Homepage: https://uri.thephpleague.com
Language: PHP
License: MIT
License Family: permissive
Topics: php, uri, uri-parser, rfc-3986, rfc-3987, psr-7, uri-template, rfc-6570, parse-url
Last push: 2026-03-15T20:31:45+00:00

## Health v2 (maintenance only)
Score: 74/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 72, release rhythm 63, longevity 100
- inputs: {"age_days": 4068, "days_push": 171, "days_rel": 171, "gap_med": 38, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1134, forks 70 (observed 2026-08-28T04:03:43.194877+00:00)

## What it is
A PHP library for parsing, validating, formatting, and manipulating URIs according to RFC 3986, RFC 3987, RFC 6570 (URI Templates), and RFC 8141 (URN), with WHATWG URL alignment and PSR-7/PSR-17 adapters. It provides immutable URI and URI-component objects, query string handling, IDN and IPv4/IPv6 host conversion, and modern replacements for PHP's legacy parse_url-style functions.

## Use cases
- parse and manipulate urls in php
- validate uris against rfc 3986
- expand uri templates with rfc 6570
- resolve relative urls against a base uri
- normalize or relativize links
- handle internationalized domain names in urls
- replace php's unreliable parse_url with a standards-based parser
- get a psr-7 compatible uri object for http messages

## When to choose
- you are writing PHP 8.1+ code that needs standards-compliant URI parsing, validation, or rewriting
- you need PSR-7/PSR-17 URI integration for HTTP clients or frameworks
- you must support IDN hosts, IPv4/IPv6 conversion, URN (RFC 8141), or URI template expansion
- you want immutable, object-oriented URL handling instead of PHP's legacy parse_url/string functions

## When to avoid
- your project is not in PHP or runs on PHP below 8.1
- you only need a full HTTP client or web crawler rather than URI manipulation itself
- you need a general-purpose data serialization or templating tool rather than URL handling

## Facets
- artifact type: library
- maturity: active
- function: parser
- domain: web-development, parsers, apis
- platform: php
- tags: uri, url, url-parsing, rfc-3986, rfc-3987, rfc-6570, rfc-8141, uri-template, psr-7, psr-17, whatwg-url, idn, ipv6, urn

## Member repositories
- thephpleague/uri (main) score 74

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:43.194877+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:37:22.783355+00:00, confidence not recorded.
  - readme: https://github.com/thephpleague/uri (fetched 2026-08-28T04:03:43.194877+00:00, sha bd4310c09c4b)
  - homepage: https://uri.thephpleague.com (fetched 2026-08-29T12:41:56.322541+00:00, sha 89d8cdec2ed3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
