Skip to main content
Help us improve Python packaging – donate today!

Python CGI Server - Perfect To Deliver PHP Files Within A Python CherryPy Application

Project Description

Mit dem CherryPy Tool cherrypy-cgiserver kann man aus CherryPy einen vollwertigen CGI-Server (Common Gateway Interface) machen. Damit lassen sich sogar PHP-Dateien ausführen und ausliefern. Es muss nur der PHP-Interpreter auf dem Computer installiert sein. Ein zusätzlicher Apache-Server ist nicht nötig.

So einfach lässt sich aus CherryPy ein vollwertiger PHP-Server machen:

#!/usr/bin/env python
# coding: utf-8

import os
import cherrypy
import cpcgiserver

THISDIR = os.path.dirname(os.path.abspath(__file__))

def main():
    config = {
        "global": {
            "server.socket_host": "0.0.0.0",
            "server.socket_port": 8080,
        },
        "/": {
            "tools.cgiserver.on": True,
            "tools.cgiserver.dir": THISDIR,
            "tools.cgiserver.base_url": "/",
            "tools.cgiserver.handlers": {".php": "/usr/bin/php-cgi"},
        }
    }
    app = cherrypy.Application(None, config = config)
    cherrypy.quickstart(app, config = config)

if __name__ == "__main__":
    main()

Installation

pip install cherrypy-cgiserver or easy_install cherrypy-cgiserver

Release history Release notifications

This version
History Node

0.3.6

History Node

0.3.5

History Node

0.3.4

History Node

0.3.3

History Node

0.3.2

History Node

0.3.1

History Node

0.2.9

History Node

0.2.7

History Node

0.2.6

History Node

0.2.5

History Node

0.2.4

History Node

0.2.4.a

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
cherrypy-cgiserver-0.3.6.tar.gz (50.5 kB) Copy SHA256 hash SHA256 Source None Aug 25, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page