# GuzzleHttp\Exception\ConnectException: cURL error 1: Protocol "http2" not supported or disabled in libcurl (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in /var/www/app/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:187

- **ID:** `php/guzzle-http-version-not-supported`
- **Domain:** php
- **Category:** protocol_error
- **Error Code:** `1`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The installed libcurl version does not support HTTP/2, but the Guzzle client is configured to use 'http2' as the protocol version.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Guzzle 7.0 | active | — | — |
| Guzzle 7.5 | active | — | — |
| PHP 8.1 | active | — | — |
| PHP 8.2 | active | — | — |

## Workarounds

1. **Downgrade the Guzzle client to use HTTP/1.1 instead: `$client = new GuzzleHttp\Client(['version' => '1.1']);`** (90% success)
   ```
   Downgrade the Guzzle client to use HTTP/1.1 instead: `$client = new GuzzleHttp\Client(['version' => '1.1']);`
   ```
2. **Upgrade libcurl to a version that supports HTTP/2. On Ubuntu/Debian: `sudo apt-get update && sudo apt-get install --only-upgrade libcurl4-openssl-dev` and then recompile PHP's cURL extension. Verify with `php -i | grep cURL` and check 'cURL Information' for HTTP2 support.** (75% success)
   ```
   Upgrade libcurl to a version that supports HTTP/2. On Ubuntu/Debian: `sudo apt-get update && sudo apt-get install --only-upgrade libcurl4-openssl-dev` and then recompile PHP's cURL extension. Verify with `php -i | grep cURL` and check 'cURL Information' for HTTP2 support.
   ```

## Dead Ends

- **Setting CURLOPT_HTTP_VERSION to CURL_HTTP_VERSION_2_0 manually in a custom handler** — This does not fix the underlying libcurl limitation; it just changes the constant used, but libcurl still cannot negotiate HTTP/2. (95% fail)
- **Reinstalling PHP and cURL extension via apt-get without checking the libcurl version** — The default system libcurl on older OS versions may still lack HTTP/2 support; you need to ensure the libcurl-dev package is from a version that supports HTTP/2 (e.g., >= 7.50.0). (70% fail)
