Comm. between Python and PHP

Noah noahspurrier at gmail.com
Tue Feb 22 20:11:49 EST 2005


It wasn't quite clear, but I assume that you want a PHP script that
can call on the Python daemon and not have the daemon make
calls to a PHP script.

You could use xml-rpc which is built into Python as of version 2.2:
    http://docs.python.org/lib/module-xmlrpclib.html
On the PHP side xmlrpc is still experimental. You have to
enable this when you build PHP:
    http://us3.php.net/manual/en/ref.xmlrpc.php

You could also just add a simple HTTP interface to your daemon.
It's pretty easy to add an HTTP interface to your daemon.
Look at SimpleHTTPServer the docs:
    http://docs.python.org/lib/module-SimpleHTTPServer.html
You will also need to read the source for SimpleHTTPServer.py to
figure out how it works (I don't know why they don't just put the
example
in the docs instead of putting the example in the source).

Yours,
Noah




More information about the Python-list mailing list