- What is hollodotme/fast-cgi-client used for in a Laravel application?
- It is a PHP FastCGI client that sends synchronous and asynchronous requests directly to PHP-FPM, bypassing the web server. In Laravel it fits best in artisan commands, health checks, integration tests, and internal workers rather than public-facing traffic. It is framework-agnostic, so Laravel integration is usage-level rather than a package-provided service provider.
- How do I install hollodotme/fast-cgi-client with Composer?
- Run composer require hollodotme/fast-cgi-client. Confirm PHP 8.0 or newer and the fileinfo extension are available before installing the 4.x line. If you are not ready for the 4.0 BC breaks, pin the 3.x release in production while you prepare a migration branch.
- Does hollodotme/fast-cgi-client support Laravel 10, 11, or 12?
- There is no explicit Laravel 10, 11, or 12 framework compatibility matrix in the provided information; PHP 8.0 through 8.5 compatibility is validated by the test suite. The package is not a Laravel-specific integration, so framework support depends on your app's PHP runtime and usage. Test it in your target Laravel version, especially if you extend request or response classes.
- What PHP versions and extensions are required for fast-cgi-client 4.x?
- Version 4.x requires PHP 8.0 or newer and is validated across PHP 8.0 through 8.5. The fileinfo extension is now required, so verify it is enabled in containers, CI, and production. You must drop PHP 7.x targets before upgrading.
- How do I connect to PHP-FPM over a network or unix domain socket?
- Create a network socket connection for TCP host/port access or a unix domain socket connection for a local FPM socket path. Then send requests through that connection; the library supports both synchronous and asynchronous handling. Choose the socket type that matches your PHP-FPM pool configuration and deployment topology.
- Can I send multiple asynchronous FastCGI requests in a loop?
- Yes, the client supports synchronous and asynchronous requests and is extended for handling multiple requests in loops. Use the response-reading methods to collect results, but be aware that timeouts now apply and unreadable responses can throw exceptions. For hardening, consider the retry-on-write-failure behavior via tryRequest rather than bundling it into a migration PR.
- What are the breaking changes in hollodotme/fast-cgi-client 4.0.0?
- Request content is now a ComposesRequestContent object; setContent changed signature and semantics, and newWithRequestContent was removed. Custom ConfiguresSocketConnection implementations need getStreamSelectTimeout, and custom ProvidesResponseData implementations need getStatusCode. Audit custom AbstractRequest subclasses for method-name collisions with newly public methods such as tryRequest, setQueryParams, and getStatusCode.
- How do I migrate from setContent() or newWithRequestContent() in v4?
- Treat 4.0.0 as a major upgrade and inventory every use of setContent, newWithRequestContent, custom request subclasses, and custom socket or response implementations. Rewrite content construction with UrlEncodedFormData, PlainText, or a custom ComposesRequestContent implementation. Add the new interface methods and follow the documented migration guide before adopting optional retry and timeout features.
- How do timeouts and unreadable responses work in waitForResponse and readResponses?
- waitForResponse and waitForResponses now time out at the connection read/write timeout, so long-running scripts no longer wait indefinitely by default. readResponses and readReadyResponses throw when a response is unreadable instead of silently skipping it. Configure timeouts deliberately and update existing error handling to catch TimedoutException and response-read failures.
- Is hollodotme/fast-cgi-client actively maintained and what license does it use?
- The package has an active 2026 release with a migration guide, per-major-version docs, PHPStan level 8, PHPCS/PSR-12, and continuous FastCGI cross-server compatibility testing. The license status is listed as NOASSERTION in the assessment, so it remains a legal review item. Confirm licensing with your legal team before production adoption.