Skip to content

Headers and client library minor version mismatch

If you are seeing this error message in PHP:

Headers and client library minor version mismatch: The version of the headers (X) does not match the version of the client library (Y).

it may be caused by a mismatch between the version of the PHP client library that you are using and the version of the API that it is trying to access. Note that exact error wording varies by library.

To fix this issue, ensure that you are using a version of the PHP client library that is compatible with the API version you are targeting. You may need to update or downgrade the library depending on your API requirements. Use composer require to target a specific version or constraint:

bash
composer require vendor/package-name:^1.2

For precise control, pin the version directly in your composer.json:

json
{
  "require": {
    "vendor/package-name": "1.2.3"
  }
}

The error can also stem from a mismatch between the client library and the HTTP API version headers it sends. Ensure you are using the correct API version configuration for your library. Consult the library's documentation or contact the maintainer for ecosystem-specific guidance. If you are using a custom client library, verify that the version constants and API endpoint headers match your target service version.

Dual-run preview — compare with live Symfony routes.