Download the PHP package phpfastcgi/fastcgi-daemon without Composer

On this page you can find all versions of the php package phpfastcgi/fastcgi-daemon. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package fastcgi-daemon

FastCGI Daemon

Latest Stable Version Build Status Coverage Status Scrutinizer Code Quality Total Downloads

A FastCGI daemon written in PHP. Visit the project website for more documentation and guides.

Check out the project performance benchmarks to see how we got a "Hello, World!" Slim application to handle 5,500 rq/s.

Introduction

Using this daemon, applications can stay alive between HTTP requests whilst operating behind the protection of a FastCGI enabled web server.

The daemon requires a handler to be defined that accepts request objects and returns PSR-7 or HttpFoundation responses.

The Speedfony Bundle integrates this daemon with the Symfony2 framework. The Slim Adapter integrates this daemon with the Slim v3 framework. The Silex Adapter integrates this daemon with the Silex framework.

There is also an un-official ZF2 Adapter that integrates this daemon with Zend Framework 2.

Current Status

This project is currently in early stages of development and not considered stable.

Contributions and suggestions are welcome.

Usage

Below is an example of a simple 'Hello, World!' FastCGI application. There are 3 examples. One with the PHPFastCGI request, one with Symfony HTTP Foundation request and one with PSR-7 Request.

PHPFastCGI request

Using the pure PHPFastCGI is the fastest method since it does not involve any converting of requests.

We need a PSR-7 implementation's response object.

Symfony HTTP Foundation Request

Use this when your application is taking advantage of the Symfony echosystem.

PSR-7 Request

Here is the same example but with PSR-7 HTTP objects. First you need to install any PSR-17 (HTTP Factory) implementation and then a PSR-17 utility library (nyholm/psr7-server).

Server Configuration

NGINX

With NGINX, you need to use a process manager such as supervisord to manage instances of your application. Have a look at AstroSplash for an example supervisord configuration.

Below is an example of the modification that you would make to the Symfony NGINX configuration. The core principle is to replace the PHP-FPM reference with one to a cluster of workers.

Apache 2.4.10 +

If you are using Apache 2.4.10 or later you need to use mod_proxy_fcgi. You need to use a process manager such as supervisord to manage instances of your application. For development you only need to start you application (see Running the server) then add the following to your VirtualHost config:

Go to http://127.0.0.1/index.php to test your setup. Note that index.php needs to exist but could be an empty file.

Apache 2.0 - 2.2

If you wish to configure your FastCGI application to work with the apache web server, you can use the apache FastCGI module to process manage your application.

This can be done by creating a FCGI script that launches your application and inserting a FastCgiServer directive into your virtual host configuration.

Here is an example script.fcgi:

See other commands to run the server here.

In your configuration, you can use the FastCgiServer directive to inform Apache of your application.

Running the server

Depending on your setup, you will have different ways of running the server. In a normal PHP application where you have created your own fastCGI_app.php (see how), you may start the server simply by:

In a Symfony application where you have registered DaemonRunCommand as a service, you may just run:

Command options

When you run the command you have a few option you could pass to it.

Auto shutdown

--auto-shutdown

Perform a graceful shutdown after receiving a 5XX HTTP status code.

Driver

--driver userland

The implementation of the FastCGI protocol to use.

File descriptor

--fd 4711

File descriptor to listen on - defaults to FCGI_LISTENSOCK_FILENO.

Host

--host 127.0.0.1

TCP host to listen on.

Memory Limit

--memory-limit 256m

The memory limit on the daemon instance before shutting down.

Port

--port 5000

TCP port to listen on (if not present, daemon will listen on FCGI_LISTENSOCK_FILENO).

Quiet

--quiet

Reduces the number of log output in the console.

Request limit

--request-limit 56

The maximum number of requests to handle before shutting down.

Time limit

--time-limit 120

The time limit on the daemon in seconds before shutting down.

Verbose

--verbose or -v

Increases the log output in the console.

Example run


All versions of fastcgi-daemon with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
psr/http-message Version ~1.0
psr/log Version ~1.0
symfony/console Version ^3.4 || ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package phpfastcgi/fastcgi-daemon contains the following files

Loading the files please wait ....