A PHP FastCGI client for sending synchronous and asynchronous requests to PHP-FPM via network or Unix domain sockets.
Fast CGI Client is a PHP library that implements the FastCGI protocol to send requests directly to PHP-FPM. It allows developers to execute PHP scripts synchronously or asynchronously without a web server, enabling efficient server-side communication and batch processing. The library handles various request types, connection methods, and provides tools for managing multiple concurrent requests.
PHP developers building applications that require direct communication with PHP-FPM, such as CLI tools, job processors, or microservices that need to execute PHP scripts programmatically.
Developers choose Fast CGI Client for its robust implementation of the FastCGI protocol, support for both synchronous and asynchronous patterns, and its ability to handle complex scenarios like file uploads and real-time output streaming. It is a modern, well-tested alternative to lower-level socket programming.
A PHP fast CGI client for sending requests (a)synchronously to PHP-FPM
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports both synchronous and asynchronous requests with callback systems, enabling efficient fire-and-forget operations and reactive handling, as shown in the README's examples with waitForResponses and pass-through callbacks.
Connects via network sockets or Unix domain sockets with configurable timeouts, providing versatility for different deployment environments, such as local development or production setups.
Includes dedicated classes for URL-encoded, multipart form data (with file uploads), and JSON payloads, simplifying complex data transmission without manual encoding.
Allows sending multiple requests in loops with ordered or reactive response reading, ideal for batch processing scenarios where performance and concurrency are critical.
Requires absolute paths to PHP scripts, as php-fpm does not resolve relative paths, leading to potential errors like 'File not found.' and complicating dynamic script execution.
Direct FastCGI protocol handling means developers must manage details like request parameters and error logging manually, increasing boilerplate code compared to higher-level HTTP libraries.
Bypassing web servers removes built-in security features (e.g., .htaccess rules), requiring additional safeguards to prevent unauthorized script execution, as hinted by the removal of the CLI tool for security reasons.
As a niche library for PHP-FPM communication, it lacks extensive community plugins or integrations, potentially forcing custom solutions for monitoring or advanced features.