Writing a custom server.

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

    Writing a custom server.

    Hello, I am writing a custom server(www), and I need to use php.

    Right now I have it set up to just envoke php on the command line if the
    requested document ends in .php.

    I assumed that all i would have to do is set the QUERY_STRING environment
    varible for php to be able to use 'GET' data. But it doesn't set anything.

    Does anyone know what environment varibles I need to set, so that php will
    put my data into either
    $_POST, or $_GET

    btw, I have register_global s on too, but that doesn't work either.


  • octopi

    #2
    Re: Writing a custom server.

    [color=blue][color=green]
    > > At a guess you'll probably need to set REQUEST_METHOD so it knows to
    > > check QUERY_STRING.
    > >[/color]
    >
    > When I set REQUEST_METHOD I get security errors.... I haven't been able to
    > get around them.
    > I did what it said, and turned force_cgi_redir ect to off. Still didn't fix
    > the problem
    >
    >[/color]

    I just checked and they wernt security errors, but it says it can't file the
    file.



    Comment

    • Luke Ross

      #3
      Re: Writing a custom server.

      Hi,

      octopi wrote:[color=blue][color=green][color=darkred]
      >>>At a guess you'll probably need to set REQUEST_METHOD so it knows to
      >>>check QUERY_STRING.[/color]
      >>
      >>When I set REQUEST_METHOD I get security errors.... I haven't been able to
      >>get around them.
      >>I did what it said, and turned force_cgi_redir ect to off. Still didn't fix
      >>the problem[/color]
      >
      > I just checked and they wernt security errors, but it says it can't file the
      > file.[/color]

      Is that, "can't find the file"? In that case set SCRIPT_NAME and
      PATH_TRANSLATED . You really ought to ensure you're setting most of the
      variables in the CGI spec to make sure everything else works.

      I'm midly surprised it was necessary to write a custom server as there
      are web servers for almost every occasion out there. :-)

      Regards,

      Luke

      Comment

      • André Næss

        #4
        Re: Writing a custom server.

        octopi:
        [color=blue]
        > Hello, I am writing a custom server(www), and I need to use php.
        >
        > Right now I have it set up to just envoke php on the command line if the
        > requested document ends in .php.
        >
        > I assumed that all i would have to do is set the QUERY_STRING environment
        > varible for php to be able to use 'GET' data. But it doesn't set anything.
        >
        > Does anyone know what environment varibles I need to set, so that php will
        > put my data into either
        > $_POST, or $_GET[/color]

        Try looking at the PHP source code. There are modules for the different
        servers supported by PHP, and you should be able to glean something helpful
        from it.

        André Næss

        Comment

        Working...