By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,631 Members | 1,693 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,631 IT Pros & Developers. It's quick & easy.

calling php interpreter via my test web server

P: n/a
Hi
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 that 'c:\\test.php'
doesn't passed to 'c:\php\php.exe' or php.exe waste 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.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
bu******@daum.net (bucket79) wrote in message news:<95*************************@posting.google.c om>...
Hi
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 that 'c:\\test.php'
doesn't passed to 'c:\php\php.exe' or php.exe waste 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.


Not sure, but sounds like problem with slash.

What about using c:\\php\\php.exe ?

--
http://www.sendmetoindia.com - Send Me to India!
Email: rrjanbiah-at-Y!com
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.