Lightweight, single file FastCGI client for PHP.

1.0.2 2019-12-11 13:49 UTC

This package is auto-updated.

Last update: 2021-04-11 18:30:10 UTC


License Latest Stable Version Total Downloads

PHP FastCGI Client is a lightweight single file FastCGI client for PHP.

How can I use it ?


require 'vendor/autoload.php';

use Adoy\FastCGI\Client;

// Existing socket, such as Lighttpd with mod_fastcgi:
$client = new Client('unix:///path/to/php/socket', -1);

// Fastcgi server, such as PHP-FPM:
$client = new Client('localhost', '9000');
$content = 'key=value';
echo $client->request(
		'SCRIPT_FILENAME' => 'test.php',
		'SERVER_SOFTWARE' => 'php/fcgiclient',
		'REMOTE_ADDR' => '',
		'REMOTE_PORT' => '9985',
		'SERVER_ADDR' => '',
		'SERVER_PORT' => '80',
		'SERVER_NAME' => 'mag-tured',
		'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
		'CONTENT_LENGTH' => strlen($content)

Command line tool

Run a call through a network socket:

./fcgiget.php localhost:9000/status

Run a call through a Unix Domain Socket

./fcgiget.php unix:/var/run/php-fpm/web.sock/status

Note: This command line tool is provided for debuging purpose.



This project is licensed under the MIT License - for the full copyright and license information, please view the LICENSE file that was distributed with this source code.

Copyrights 2010-2019 Pierrick Charron Inc. All rights reserved.