Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[HttpClient] Require cURL > 7.37.0 #41662

Copy link
Copy link
Closed
@sebaherrera

Description

@sebaherrera
Issue body actions

Symfony version(s) affected: 5.2.10

Description
Hi. HttpClient throws when cURL version < 7.37.0, which introduced CURLOPT_HEADEROPT. It's a rare issue because compatible versions are available since PHP 7.0.7 (see https://www.php.net/manual/es/function.curl-setopt.php), but there are some hosting companies that doesn't have both upgrades aligned correctly.

How to reproduce
Make an HttpClient request as the "Basic Usage" example on documentation using a server with cURL < 7.37.0.

Possible Solution
Fix requirements on composer.json or make a fallback to NativeHttpClient, which works right on such cases.

Additional context
Log example:

{"message":"Uncaught PHP Exception Twig\Error\RuntimeError: "An exception has been thrown during the rendering of a template ("Curl option "CURLOPT_HEADEROPT" is not supported.")." at /home/c1930506/public_html/nueva-tienda/templates/categorias.html.twig line 1","context":{"exception":{"class":"Twig\Error\RuntimeError","message":"An exception has been thrown during the rendering of a template ("Curl option "CURLOPT_HEADEROPT" is not supported.").","code":0,"file":"/home/c1930506/public_html/nueva-tienda/templates/categorias.html.twig:1","previous":{"class":"Symfony\Component\HttpClient\Exception\TransportException","message":"Curl option "CURLOPT_HEADEROPT" is not supported.","code":0,"file":"/home/c1930506/public_html/nueva-tienda/vendor/symfony/http-client/CurlHttpClient.php:316"}}},"level":500,"level_name":"CRITICAL","channel":"request","datetime":"2021-06-10T16:09:26.076139-03:00","extra":{}}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.