定制 adoy/fastcgi-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adoy/fastcgi-client

最新稳定版本:1.0.2

Composer 安装命令:

composer require adoy/fastcgi-client

包简介

Lightweight, single file FastCGI client for PHP.

README 文档

README

License Latest Stable Version Total Downloads

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

How can I use it ?

<?php

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(
	array(
		'GATEWAY_INTERFACE' => 'FastCGI/1.0',
		'REQUEST_METHOD' => 'POST',
		'SCRIPT_FILENAME' => 'test.php',
		'SERVER_SOFTWARE' => 'php/fcgiclient',
		'REMOTE_ADDR' => '127.0.0.1',
		'REMOTE_PORT' => '9985',
		'SERVER_ADDR' => '127.0.0.1',
		'SERVER_PORT' => '80',
		'SERVER_NAME' => 'mag-tured',
		'SERVER_PROTOCOL' => 'HTTP/1.1',
		'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
		'CONTENT_LENGTH' => strlen($content)
	),
	$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.

Authors

License

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.

统计信息

  • 总下载量: 2.55M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 314
  • 点击次数: 1
  • 依赖项目数: 10
  • 推荐数: 0

GitHub 信息

  • Stars: 311
  • Watchers: 19
  • Forks: 56
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-10-31