communication between php and webserver

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

    communication between php and webserver

    Hi,

    can anybody point me to some reading on how communication between the webserver and php is
    established?

    I'd like to make php available to my own webserver software.

    Andreas


  • Bert Melis

    #2
    Re: communication between php and webserver

    Andreas Thiele wrote:[color=blue]
    > Hi,
    >
    > can anybody point me to some reading on how communication between the webserver and php is
    > established?
    >
    > I'd like to make php available to my own webserver software.
    >
    > Andreas
    >
    >[/color]
    What kind of server-software are you using?
    IIS? Apache?

    Comment

    • Andreas Thiele

      #3
      Re: communication between php and webserver


      "Bert Melis" <bert.melis@off site_remove_thi s_.be> schrieb im Newsbeitrag
      news:4301ff16$0 $16120$ba620e4c @news.skynet.be ...[color=blue]
      > Andreas Thiele wrote:[color=green]
      > > Hi,
      > >
      > > can anybody point me to some reading on how communication between the webserver and php is
      > > established?
      > >
      > > I'd like to make php available to my own webserver software.
      > >
      > > Andreas
      > >
      > >[/color]
      > What kind of server-software are you using?
      > IIS? Apache?[/color]

      No, I wrote one myself. It is a simple server, now capable of serving html pages, jpg and gif files.
      I wrote it for standalone delivery of my application. In this case I don't want to require the user
      to install a full blown apache or other web server.

      Now I want to implement php support into my server program.

      I already called the php.exe with i/o redirection from my program. This works if I don't need any
      parameters. I'd like to further extend this and pass parameters to php. But how?

      For example, my server obtains the request "GET /test.php?value1 =a&value2=b". Now I need a way to
      hand over value1 and value2 to php.exe. Is this possible?

      (I thought of something like "php -q test.php value1=a value2=b", but this won't work for obvious
      reason)

      Isn't there any reading on this topic available?

      Googling didn't help me much yet.

      TNX

      Andreas


      Comment

      • Chung Leong

        #4
        Re: communication between php and webserver

        If your software runs on Windows, the easiest way is to implement the
        ISAPI interface then use the existing PHP ISAPI module.

        Comment

        • Bert Melis

          #5
          Re: communication between php and webserver

          Andreas Thiele wrote:[color=blue]
          > "Bert Melis" <bert.melis@off site_remove_thi s_.be> schrieb im Newsbeitrag
          > news:4301ff16$0 $16120$ba620e4c @news.skynet.be ...
          >[color=green]
          >>Andreas Thiele wrote:
          >>[color=darkred]
          >>>Hi,
          >>>
          >>>can anybody point me to some reading on how communication between the webserver and php is
          >>>establishe d?
          >>>
          >>>I'd like to make php available to my own webserver software.
          >>>
          >>>Andreas
          >>>
          >>>[/color]
          >>
          >>What kind of server-software are you using?
          >>IIS? Apache?[/color]
          >
          >
          > No, I wrote one myself. It is a simple server, now capable of serving html pages, jpg and gif files.
          > I wrote it for standalone delivery of my application. In this case I don't want to require the user
          > to install a full blown apache or other web server.
          >
          > Now I want to implement php support into my server program.
          >
          > I already called the php.exe with i/o redirection from my program. This works if I don't need any
          > parameters. I'd like to further extend this and pass parameters to php. But how?
          >
          > For example, my server obtains the request "GET /test.php?value1 =a&value2=b". Now I need a way to
          > hand over value1 and value2 to php.exe. Is this possible?
          >
          > (I thought of something like "php -q test.php value1=a value2=b", but this won't work for obvious
          > reason)
          >
          > Isn't there any reading on this topic available?
          >
          > Googling didn't help me much yet.
          >
          > TNX
          >
          > Andreas
          >
          >[/color]
          http://www.php.net/manual/nl/features.commandline.php --> register_argc_a rgv

          Can you get your answer here?

          Comment

          • Andreas Thiele

            #6
            Re: communication between php and webserver

            Thanks for you hints.

            ISAPI includes CGI. I did not know that both are a common standard and not especially dependent on
            php. I choode CGI because it was easier to implement and more portable in my programming context.
            Performance is not an issue for me.

            CGI basically is setting environment variables. On Windows this can be illustrated by a tiny batch
            (*.bat) file. It reflects the minimum set of variables I found and the subtle ^ escape of the
            &-sign.

            @echo off
            set REDIRECT_STATUS =CGI
            set REQUEST_METHOD= GET
            set SCRIPT_FILENAME =test.php
            set QUERY_STRING=va lue1=a^&value2= b
            e:/programme/php/php.exe

            Well I don't write it into a batch. I open a pipe to cmd.exe, transmit these lines and collected the
            output to send it to the client brower. This way, now my server has a minimalistic support for php.

            Andreas


            Comment

            Working...