Reading incoming HTTP data with PHP socket

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

    Reading incoming HTTP data with PHP socket

    Hello all,

    I'm trying to implement a PHP program that can handle streaming HTTP
    data through Apache. I need to somehow get access to the incoming data
    of the HTTP request as it arrives (i.e. I don't want to access the
    FILE array).

    Is this possible with mod_php? I think that, in general, it should be
    possible as I think mod_python can do it.

    Thanks,

    Mike.
  • steve

    #2
    Re: Reading incoming HTTP data with PHP socket

    "user3201" wrote:[color=blue]
    > Hello all,
    >
    > I'm trying to implement a PHP program that can handle
    > streaming HTTP
    > data through Apache. I need to somehow get access to the
    > incoming data
    > of the HTTP request as it arrives (i.e. I don't want to access
    > the
    > FILE array).
    >
    > Is this possible with mod_php? I think that, in general, it
    > should be
    > possible as I think mod_python can do it.
    >
    > Thanks,
    >
    > Mike.[/color]

    Use fsockopen, and then use fget in a loop to catch the stream:


    --
    Posted using the http://www.dbforumz.com interface, at author's request
    Articles individually checked for conformance to usenet standards
    Topic URL: http://www.dbforumz.com/PHP-Reading-...ict189433.html
    Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbforumz.com/eform.php?p=640398

    Comment

    • Chung Leong

      #3
      Re: Reading incoming HTTP data with PHP socket

      "Mike Verdone" <mike.verdone@g mail.com> wrote in message
      news:5487f95e.0 501191347.27275 2f0@posting.goo gle.com...[color=blue]
      > Hello all,
      >
      > I'm trying to implement a PHP program that can handle streaming HTTP
      > data through Apache. I need to somehow get access to the incoming data
      > of the HTTP request as it arrives (i.e. I don't want to access the
      > FILE array).
      >
      > Is this possible with mod_php? I think that, in general, it should be
      > possible as I think mod_python can do it.[/color]

      It is not possible with mod_php. PHP will always read in the entire request
      before starting your script. If you setup the command line version of PHP as
      a CGI script, you can access the raw request through stdin. That's really a
      hack though. If mod_python can do it, let mod_python do it.


      Comment

      Working...