league/uri

URI manipulation library

Maintainers

👁 nyamsprod

Package info

github.com/thephpleague/uri

Homepage

Forum

Documentation

pkg:composer/league/uri

Fund package maintenance!

nyamsprod

Statistics

Installs: 235 151 725

Dependents: 311

Suggesters: 9

Stars: 1 129

Open Issues: 0

7.8.1 2026-03-15 20:22 UTC

Requires

Requires (Dev)

None

Suggests

  • php-64bit: to improve IPV4 host parsing
  • ext-bcmath: to improve IPV4 host parsing
  • ext-dom: to convert the URI into an HTML anchor tag
  • ext-fileinfo: to create Data URI from file contennts
  • ext-gmp: to improve IPV4 host parsing
  • ext-intl: to handle IDN host with the best performance
  • ext-uri: to use the PHP native URI class
  • jeremykendall/php-domain-parser: to further parse the URI host and resolve its Public Suffix and Top Level Domain
  • league/uri-components: to provide additional tools to manipulate URI objects components
  • league/uri-polyfill: to backport the PHP URI extension for older versions of PHP
  • rowbot/url: to handle URLs using the WHATWG URL Living Standard specification
  • symfony/polyfill-intl-idn: to handle IDN host via the Symfony polyfill if ext-intl is not present

Provides

None

Conflicts

Replaces

None


README

👁 Software License
👁 Latest Version
👁 Total Downloads

The Uri package provides simple and intuitive classes to manage URIs in PHP.

⚠️ this is a sub-split, for development, pull requests and issues, visit: https://github.com/thephpleague/uri-src

System Requirements

You require PHP >= 8.1 but the latest stable version of PHP is recommended

Handling of an IDN host requires the presence of the intl extension or a polyfill for the intl IDN functions like the symfony/polyfill-intl-idn otherwise an exception will be thrown when attempting to validate or interact with such a host.

IPv4 conversion requires at least one of the following:

  • the GMP extension,
  • the BCMatch extension or
  • a 64-bits PHP version

otherwise, an exception will be thrown when attempting to convert a host as an IPv4 address.

Parsing or generating HTML related content requires the dom extension.

Dependencies

Installation

$ composer require league/uri

Documentation

Full documentation can be found at uri.thephpleague.com.

License

The MIT License (MIT). Please see License File for more information.