FindSoftware

PHP-JWT

PHP library that encodes and decodes JSON Web Tokens (JWT) conforming to RFC 7519.

PHP-JWT encodes and decodes JSON Web Tokens in PHP. Encoding signs a payload with a key and an algorithm. Decoding takes a key object that names the algorithm the application expects, verifies the signature and the time claims, and returns the payload as a stdClass object. Keys can come from PEM strings, from a JSON Web Key Set, or from a cached key set that fetches the set from a URL and refreshes the cache when a key ID is unknown.

Decoding throws a different exception for an invalid key, an unsupported algorithm, a bad signature, a token used too early or too late, and a malformed token.

Worth knowing

The README says the application must name the algorithms it accepts, and that decoding header values before verifying the token is not supported. The EdDSA examples use libsodium. PS256 needs phpseclib installed separately, because the OpenSSL extension does not support it.

Identity

Status
Active
Maintainer
Neuman Vong3
First release
20144

Rendering and deploy

Install with
composer5

Releases

Current major version
77
Last release
2026-09-287

Adoption

GitHub stars
9,8031
Packagist downloads
551,868,3649
Contributors
838
Dependent repositories
44,89010
Dependent packages
1,77210

Why these figures do not compare

Sources

  1. 2026-11-16: links, Written in, GitHub stars
    api.github.com/repos/googleapis/php-jwt
  2. 2026-11-16: links
    docs.cloud.google.com/php/docs/reference/php-jwt/latest
  3. 2026-11-16: Maintainer
    github.com/googleapis/php-jwt/blob/main/LICENSE
  4. 2026-11-16: First release
    repo.packagist.org/p2/firebase/php-jwt.json
  5. 2026-11-16: Categories, Install with
    github.com/googleapis/php-jwt/blob/main/README.md
  6. 2026-11-16: Runtime, Minimum runtime, License
    github.com/googleapis/php-jwt/blob/v7.2.1/composer.json
  7. 2026-11-16: Current major version, Last release
    api.github.com/repos/googleapis/php-jwt/releases
  8. 2026-11-16: Contributors
    api.github.com/repos/googleapis/php-jwt/contributors?per_page=1
  9. 2026-11-16: Packagist downloads
    packagist.org/packages/firebase/php-jwt.json
  10. 2026-11-16: Dependent packages, Dependent repositories
    packages.ecosyste.ms/api/v1/registries/packagist.org/packages/firebase%2Fphp-jwt

Last reviewed · Listed since Edit on GitHubThis page as markdownas JSON