currently i'm developing simple web server which support cgi with
python in win32.
and i started from python's basic library, CGIHTTPServer.
it support cgi but only for extension like .exe .py.
so now i just wanna add php extension
here's cgi handling schem of this webserver.
first it check requested file's extension. and then if it is 'py' then
it call's popen2('python requested-script'). now we can handle input
and output file descriptor of this process.
it's very simple :)
so i add some code for handling php likewise.
first i turned off the cgi.force_redirect.
and called popen2('python some-request-script') but it shows 'No input
file specified'
i tested this thing's in python's interactive interpreter in directly
then it shows right. let me show some code
files = os.popen2("c:\\php\\php.exe c:\\test.php")
files[1].read()
"Content-type: text/html\nX-Powered-By: PHP/4.3.5\n\nhere's php"
but when i run this code via http server, it seems like 'c:\\test.php'
doesn't passed to 'c:\\php\\php.exe'
i think php.exe waste it's stdin
how can i handle this problem?
any posting would be appreciated :)
ps.is there anyone who made supporting for php interpretion with own
web server? please let me show some example.