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.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
FastCGIClient.py
README.md
fcgi.py

README.md

Python FastCGI Client

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

AUTHOR & Email

wuyunfeng - wyfsky888@126.com

How use?(You should start your FastCGI Process)

from FastCGIClient import *
client = FastCGIClient('127.0.0.1', 9000, 3000, 0)
params = dict()
documentRoot = "/Users/baidu/php_workspace"
uri = "/echo.php"
content = "name=john&address=beijing"
params = {'GATEWAY_INTERFACE': 'FastCGI/1.0',
      'REQUEST_METHOD': 'POST',
      'SCRIPT_FILENAME': documentRoot + uri,
      'SCRIPT_NAME': uri,
      'QUERY_STRING': '',
      'REQUEST_URI': uri,
      'DOCUMENT_ROOT': documentRoot,
      'SERVER_SOFTWARE': 'php/fcgiclient',
      'REMOTE_ADDR': '127.0.0.1',
      'REMOTE_PORT': '9985',
      'SERVER_ADDR': '127.0.0.1',
      '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.