Download the PHP package lisachenko/protocol-fcgi without Composer
On this page you can find all versions of the php package lisachenko/protocol-fcgi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package protocol-fcgi
PHP FastCGI Protocol
A zero-dependency, object-oriented implementation of the FastCGI 1.0 binary protocol for PHP.
FastCGI is the battle-tested protocol that web servers like nginx, Apache and Caddy use to
talk to php-fpm â billions of requests flow through it every day. This library gives you
the protocol itself as a clean, strictly-typed PHP API, so you can build your own
high-performance FastCGI clients (talk to php-fpm directly, no web server in between)
and servers (long-running PHP daemons that nginx can speak to natively).
âĻ Key Features
- ðĶ Complete protocol coverage â all 11 FastCGI record types, including the
management records (
GET_VALUES,GET_VALUES_RESULT,UNKNOWN_TYPE) - ð Streaming frame parser â feed partial socket reads into
FrameParser::hasFrame()/parseFrame()and get fully-typed record objects out as soon as they are complete - ð Byte-exact round-tripping â every record packs back to the exact wire bytes it was parsed from; the test suite is pinned to hex fixtures captured from real traffic
- ð Automatic 8-byte padding â content alignment is handled for you, as the spec recommends
- ð·ïļ Full name-value pair encoding â including the 4-byte long form for names and values over 127 bytes
- ðŊ Native enums for the protocol vocabulary â record types, roles and protocol
statuses are backed enums (
RecordType,Role,ProtocolStatus), so invalid wire values fail fast with a dedicatedProtocolException - ðŠķ Zero runtime dependencies â pure PHP, nothing but the language itself
- ð Strict types + PHPStan at the maximum level â the whole codebase (tests included) passes static analysis at the strictest setting
Requirements
- PHP >= 8.4
Installation
Usage
The library implements both sides of the wire: use it to send FastCGI requests as a client, or to receive and answer them as a server. The full protocol specification is available at fast-cgi.github.io/spec.
FastCGI client: query php-fpm directly
FastCGI server: accept requests from a web server
Quality
License
Released under the MIT license.