PHPackages                             hollodotme/fast-cgi-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. hollodotme/fast-cgi-client

ActiveLibrary[Queues &amp; Workers](/categories/queues)

hollodotme/fast-cgi-client
==========================

A PHP fast CGI client to send requests (a)synchronously to PHP-FPM.

v3.1.7(4y ago)56423.9M—3.6%33[9 issues](https://github.com/hollodotme/fast-cgi-client/issues)[5 PRs](https://github.com/hollodotme/fast-cgi-client/pulls)20MITPHPPHP &gt;=7.1CI failing

Since Jan 3Pushed 2y ago17 watchersCompare

[ Source](https://github.com/hollodotme/fast-cgi-client)[ Packagist](https://packagist.org/packages/hollodotme/fast-cgi-client)[ RSS](/packages/hollodotme-fast-cgi-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (46)Used By (20)

[![FastCGI Client CI PHP 7.1 - 8.1](https://github.com/hollodotme/fast-cgi-client/workflows/FastCGI%20Client%20CI%20PHP%207.1%20-%208.1/badge.svg)](https://github.com/hollodotme/fast-cgi-client/workflows/FastCGI%20Client%20CI%20PHP%207.1%20-%208.1/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/a2259ef01d65373682f8b21d3279996392dd86ea6c9bb8a266c3f44f97a5ac6e/68747470733a2f2f706f7365722e707567782e6f72672f686f6c6c6f646f746d652f666173742d6367692d636c69656e742f762f737461626c65)](https://packagist.org/packages/hollodotme/fast-cgi-client)[![Total Downloads](https://camo.githubusercontent.com/965889700e6a31a208c86ffec1f40687c0f8a993597d05c157d7e599ee4a1e1d/68747470733a2f2f706f7365722e707567782e6f72672f686f6c6c6f646f746d652f666173742d6367692d636c69656e742f646f776e6c6f616473)](https://packagist.org/packages/hollodotme/fast-cgi-client)

Fast CGI Client
===============

[](#fast-cgi-client)

A PHP fast CGI client to send requests (a)synchronously to PHP-FPM using the [FastCGI Protocol](http://www.mit.edu/~yandros/doc/specs/fcgi-spec.html).

This library is based on the work of [Pierrick Charron](https://github.com/adoy)'s [PHP-FastCGI-Client](https://github.com/adoy/PHP-FastCGI-Client/)and was ported and modernized to latest PHP versions, extended with some features for handling multiple requests (in loops) and unit and integration tests as well.

---

This is the documentation of the latest release.

Please have a look at the [backwards incompatible changes (BC breaks) in the changelog](./CHANGELOG.md).

Please see the following links for earlier releases:

- PHP &gt;= 7.0 (EOL) [v1.0.0](https://github.com/hollodotme/fast-cgi-client/blob/v1.0.0/README.md), [v1.0.1](https://github.com/hollodotme/fast-cgi-client/blob/v1.0.1/README.md), [v1.1.0](https://github.com/hollodotme/fast-cgi-client/blob/v1.1.0/README.md), [v1.2.0](https://github.com/hollodotme/fast-cgi-client/blob/v1.2.0/README.md), [v1.3.0](https://github.com/hollodotme/fast-cgi-client/blob/v1.3.0/README.md), [v1.4.0](https://github.com/hollodotme/fast-cgi-client/blob/v1.4.0/README.md), [v1.4.1](https://github.com/hollodotme/fast-cgi-client/blob/v1.4.1/README.md), [v1.4.2](https://github.com/hollodotme/fast-cgi-client/blob/v1.4.2/README.md)
- PHP &gt;= 7.1 [v2.0.0](https://github.com/hollodotme/fast-cgi-client/blob/v2.0.0/README.md), [v2.0.1](https://github.com/hollodotme/fast-cgi-client/blob/v2.0.1/README.md), [v2.1.0](https://github.com/hollodotme/fast-cgi-client/blob/v2.1.0/README.md), [v2.2.0](https://github.com/hollodotme/fast-cgi-client/blob/v2.2.0/README.md), [v2.3.0](https://github.com/hollodotme/fast-cgi-client/blob/v2.3.0/README.md), [v2.4.0](https://github.com/hollodotme/fast-cgi-client/blob/v2.4.0/README.md), [v2.4.1](https://github.com/hollodotme/fast-cgi-client/blob/v2.4.1/README.md), [v2.4.2](https://github.com/hollodotme/fast-cgi-client/blob/v2.4.2/README.md), [v2.4.3](https://github.com/hollodotme/fast-cgi-client/blob/v2.4.3/README.md), [v2.5.0](https://github.com/hollodotme/fast-cgi-client/blob/v2.5.0/README.md), [v2.6.0](https://github.com/hollodotme/fast-cgi-client/blob/v2.6.0/README.md), [v2.7.0](https://github.com/hollodotme/fast-cgi-client/blob/v2.7.0/README.md), [v2.7.1](https://github.com/hollodotme/fast-cgi-client/blob/v2.7.1/README.md), [v2.7.2](https://github.com/hollodotme/fast-cgi-client/blob/v2.7.2/README.md), [v3.0.0-alpha](https://github.com/hollodotme/fast-cgi-client/blob/v3.0.0-alpha/README.md), [v3.0.0-beta](https://github.com/hollodotme/fast-cgi-client/blob/v3.0.0-beta/README.md), [v3.0.0](https://github.com/hollodotme/fast-cgi-client/blob/v3.0.0/README.md), [v3.0.1](https://github.com/hollodotme/fast-cgi-client/blob/v3.0.1/README.md), [v3.1.0](https://github.com/hollodotme/fast-cgi-client/blob/v3.1.0/README.md), [v3.1.1](https://github.com/hollodotme/fast-cgi-client/blob/v3.1.1/README.md), [v3.1.2](https://github.com/hollodotme/fast-cgi-client/blob/v3.1.2/README.md), [v3.1.3](https://github.com/hollodotme/fast-cgi-client/blob/v3.1.3/README.md), [v3.1.4](https://github.com/hollodotme/fast-cgi-client/blob/v3.1.4/README.md), [v3.1.5](https://github.com/hollodotme/fast-cgi-client/blob/v3.1.5/README.md)

Read more about the journey to and changes in `v2.6.0`in [this blog post](https://github.com/hollodotme/fast-cgi-client/wiki/Background-Info-FastCgiClient-Version-2.6.0).

---

You can find an experimental use-case in my related blog posts:

- [Experimental async PHP vol. 1](https://github.com/hollodotme/fast-cgi-client/wiki/Experimental-Async-Php-Volume-1)
- [Experimental async PHP vol. 2](https://github.com/hollodotme/fast-cgi-client/wiki/Experimental-Async-Php-Volume-2)

You can also find slides of my talks about this project on [speakerdeck.com](https://speakerdeck.com/hollodotme).

---

Installation
------------

[](#installation)

```
composer require hollodotme/fast-cgi-client
```

---

Usage - connections
-------------------

[](#usage---connections)

This library supports two types of connecting to a FastCGI server:

1. Via network socket
2. Via unix domain socket

### Create a network socket connection

[](#create-a-network-socket-connection)

```
