Skip to main content

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

Lizenzen

Metadata

Release files for cherrypy-cgiserver 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cherrypy-cgiserver 0.3.6
File Size Uploaded
cherrypy-cgiserver-0.3.6.tar.gz 50.5 kB Details

Release files / cherrypy-cgiserver-0.3.6.tar.gz

Download URL cherrypy-cgiserver-0.3.6.tar.gz
Size 50.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c98a57597bb461d02ae71d9a41e1756dc5bb36298dc917e71c84363c72275ce9
BLAKE2b-256 checksum
How to use checksums
fdc1ee6a93f55b301ad190859c48a1269cd448673ba75ec501afb4fd6741f569
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.6 This release

1 release file

0.3.5

1 release file

0.3.4

0.3.3

0.3.2

0.3.1

0.2.9

0.2.7

0.2.6

0.2.5

0.2.4

0.2.4.a

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page