Skip to content
A FastCGI Client for Python (directly communicate with fastcgi-server such as PHP-FPM etc.) NOTE: Do not support python 3.x.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Python FastCGI Client

A Python FastCGI Client for directly access FastCGI web resource through FastCGI

AUTHOR & Email

wuyunfeng -

How use?(You should start your FastCGI Process)

from FastCGIClient import *
client = FastCGIClient('', 9000, 3000, 0)
params = dict()
documentRoot = "/Users/baidu/php_workspace"
uri = "/echo.php"
content = "name=john&address=beijing"
params = {'GATEWAY_INTERFACE': 'FastCGI/1.0',
      'SCRIPT_FILENAME': documentRoot + uri,
      'SCRIPT_NAME': uri,
      'QUERY_STRING': '',
      'REQUEST_URI': uri,
      'DOCUMENT_ROOT': documentRoot,
      'SERVER_SOFTWARE': 'php/fcgiclient',
      'REMOTE_ADDR': '',
      'REMOTE_PORT': '9985',
      'SERVER_ADDR': '',
      'SERVER_PORT': '80',
      'SERVER_NAME': "localhost",
      'SERVER_PROTOCOL': 'HTTP/1.1',
      'CONTENT_TYPE': 'application/x-www-form-urlencoded',
      'CONTENT_LENGTH': len(content)
client.request(params, content)
You can’t perform that action at this time.