calling php interpreter via my test web server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bucket79

    calling php interpreter via my test web server

    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_redir ect.
    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
    [color=blue][color=green][color=darkred]
    >>> files = os.popen2("c:\p hp\php.exe c:\\test.php")
    >>> files[1].read()[/color][/color][/color]
    "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.
  • R. Rajesh Jeba Anbiah

    #2
    Re: calling php interpreter via my test web server

    bucket79@daum.n et (bucket79) wrote in message news:<95f72778. 0404160003.87db d1e@posting.goo gle.com>...[color=blue]
    > 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_redir ect.
    > 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
    >[color=green][color=darkred]
    > >>> files = os.popen2("c:\p hp\php.exe c:\\test.php")
    > >>> files[1].read()[/color][/color]
    > "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.[/color]

    Not sure, but sounds like problem with slash.

    What about using c:\\php\\php.ex e ?

    --
    http://www.sendmetoindia.com - Send Me to India!
    Email: rrjanbiah-at-Y!com

    Comment

    Working...