PHPackages                             hoa/fastcgi - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. hoa/fastcgi

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

hoa/fastcgi
===========

The Hoa\\Fastcgi library.

3.19.03.08(7y ago)61188.5k—2.7%16[1 PRs](https://github.com/hoaproject/Fastcgi/pulls)3BSD-3-ClausePHP

Since Sep 16Pushed 7y ago12 watchersCompare

[ Source](https://github.com/hoaproject/Fastcgi)[ Packagist](https://packagist.org/packages/hoa/fastcgi)[ Docs](https://hoa-project.net/)[ RSS](/packages/hoa-fastcgi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (15)Used By (3)

 [![Hoa](https://camo.githubusercontent.com/2b5c32c5d4bc5e9298821b22d364a522e2dbc0295c1c011b1f9f86a4d07df07e/68747470733a2f2f7374617469632e686f612d70726f6a6563742e6e65742f496d6167652f486f612e737667)](https://camo.githubusercontent.com/2b5c32c5d4bc5e9298821b22d364a522e2dbc0295c1c011b1f9f86a4d07df07e/68747470733a2f2f7374617469632e686f612d70726f6a6563742e6e65742f496d6167652f486f612e737667)

---

 [![Build status](https://camo.githubusercontent.com/f5de37b96e34bfc61525ce64736843f58be93ce0c3378979285d05f11f3d756b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f686f6170726f6a6563742f666173746367692f6d61737465722e737667)](https://travis-ci.org/hoaproject/fastcgi) [![Code coverage](https://camo.githubusercontent.com/7a5714a1f8f77374e4fedb39e92d4883de32ae0f9bcc2679155137082eff8f31/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f686f6170726f6a6563742f666173746367692f6d61737465722e737667)](https://coveralls.io/github/hoaproject/fastcgi?branch=master) [![Packagist](https://camo.githubusercontent.com/ddfa6082a7cbf1248727015eed9a9c065d47c9cb7474f0beb37d6a93b8f2e238/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f686f612f666173746367692e737667)](https://packagist.org/packages/hoa/fastcgi) [![License](https://camo.githubusercontent.com/67276e3115cda9974084f14579580d01d4abeecbca7afa21f167bdbefd77fd00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f686f612f666173746367692e737667)](https://hoa-project.net/LICENSE)

 Hoa is a **modular**, **extensible** and **structured** set of PHP libraries.
 Moreover, Hoa aims at being a bridge between industrial and research worlds.

Hoa\\Fastcgi
============

[](#hoafastcgi)

[![Help on IRC](https://camo.githubusercontent.com/4dbc9c9d28c30cf1ab591f4bb8212fe4dbddc734145df532a9bb86b09878d4c6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f68656c702d253233686f6170726f6a6563742d6666303036362e737667)](https://webchat.freenode.net/?channels=#hoaproject)[![Help on Gitter](https://camo.githubusercontent.com/8c4c85951788ff606b1268cb3dd946be05e3054795455d0a7b9250711bc2ac05/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f68656c702d6769747465722d6666303036362e737667)](https://gitter.im/hoaproject/central)[![Documentation](https://camo.githubusercontent.com/7059ad5f1a363f9098686c59d432f01d7330aed9d4b6c8111d985fd64cfc6c60/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f646f63756d656e746174696f6e2d6861636b5f626f6f6b2d6666303036362e737667)](https://central.hoa-project.net/Documentation/Library/Fastcgi)[![Board](https://camo.githubusercontent.com/fd81654ba14b3aca3a713e1b471bc3fc3ba7b5bb3761ccffd6eea2e2ed1fa5ca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6f7267616e69736174696f6e2d626f6172642d6666303036362e737667)](https://waffle.io/hoaproject/fastcgi)

This library allows to manipulate the [FastCGI](http://fastcgi.com/) protocol, which ensures the communication between a HTTP server and an external program (such as PHP).

[Learn more](https://central.hoa-project.net/Documentation/Library/Fastcgi).

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

[](#installation)

With [Composer](https://getcomposer.org/), to include this library into your dependencies, you need to require [`hoa/fastcgi`](https://packagist.org/packages/hoa/fastcgi):

```
$ composer require hoa/fastcgi '~3.0'
```

For more installation procedures, please read [the Source page](https://hoa-project.net/Source.html).

Testing
-------

[](#testing)

Before running the test suites, the development dependencies must be installed:

```
$ composer install
```

Then, to run all the test suites:

```
$ vendor/bin/hoa test:run
```

For more information, please read the [contributor guide](https://hoa-project.net/Literature/Contributor/Guide.html).

Quick usage
-----------

[](#quick-usage)

As a quick overview, we propose to execute a PHP file through the FastCGI protocol directly.

Before starting, we need to know that PHP proposes two tools that support FastCGI: `php-cgi` and `php-fpm` (for [FastCGI Process Manager](http://php.net/install.fpm)). We will use `php-cgi` in local with the standard port `9000` in TCP:

```
$ php-cgi -b 127.0.0.1:9000
```

First, we write the `Echo.php` file, the one we are likely to execute:

```
