Skip to content

[13.x] Support Guzzle 8 and persistent connections across php-fpm requests#60321

Draft
GrahamCampbell wants to merge 1 commit into
13.xfrom
guzzle-8
Draft

[13.x] Support Guzzle 8 and persistent connections across php-fpm requests#60321
GrahamCampbell wants to merge 1 commit into
13.xfrom
guzzle-8

Conversation

@GrahamCampbell

@GrahamCampbell GrahamCampbell commented May 29, 2026

Copy link
Copy Markdown
Collaborator

This PR adds support for Guzzle 8, while maintaining Guzzle 7 support. Guzzle 8 comes with a significant new feature: PHP 8.5+ users with ext-curl installed can have connections shared across php-fpm requests. I've implemented this with the following DX:

// app/Providers/AppServiceProvider.php
use Illuminate\Support\Facades\Http;
use Illuminate\Http\Client\PersistentTransport;

public function boot(): void
{
    Http::globalPersistentTransport(PersistentTransport::Preferred);
}

The PersistentTransport surfaces 3 options:

  • None: Do not try and share connections. This is the current behaviour, and remains the default.
  • Preferred: Try to share connections, but if we are not able to, silently fallback to None.
  • Required: Try to share connections, and if we are not able to, fail loud.

Just looking at the Laravel code, it may look like Laravel is controlling the fallback logic, but that is not the full story. Guzzle also handles falling back


Before this PR can be merged, a few things need to happen:

  • Guzzle 8.0.0 stable needs to be released.
  • The AWS SDK needs to support Guzzle 8.

Follow up activities:

  • Update the Pusher SDK to support Guzzle 8.
  • Update the Resend SDK to support Guzzle 8.
  • Update Laravel first-party packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant