Coder Social home page Coder Social logo

pyfcgiclient's Introduction

pyfcgiclient

A Python client interface to FastCGI servers.

This code is mostly modified code found in the ZTC project on BitBucket, which in turn is based on code from flup.

Please note that this is still very much a WIP. Any comments and patches are welcome.

Example

from pyfcgiclient.fpm import FPM

phpfpm = FPM(
    host='127.0.0.1',
    port=9000,
    document_root='/var/www/'
)

post_string = 'title=Hello&body=World!'

status_header, headers, output, error_message = phpfpm.load_url(
    url='/index.php?a=b',
    content=post_string,
    remote_addr='192.0.43.10',
    cookies='c=d;e=f;'
)

TODO

  • Create setup
  • Fix unicode/ASCII errors

pyfcgiclient's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ltd-beget jackzzg

pyfcgiclient's Issues

something wrong with 404 not found?

Hi. i tried run the script for test a remote fcgiserver (runing with php-fpm )
but it always return 404 not found. . the version of php is 5.3.3

i tried set the document_root env to '/', and post script_filename as /etc/issue, it returns 404. ofcuz the file does exsist.

from pyfcgiclient.fpm import FPM
print FPM(host='10.1.1.3',port=9000,document_root='/').load_url(url='/etc/issue')
('404 Not Found', [('x-powered-by', 'PHP/5.3.3'), ('content-type', 'text/html')], 'No input file specified.\n', '')

but it works ok on php 5.3.10.... returns 403(means the file does exist).

what's wrong with the code? the php-cgi has default settings.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.