Connecting Tech Pros Worldwide Help | Site Map

Reading incoming HTTP data with PHP socket

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 17th, 2005, 10:49 AM
Mike Verdone
Guest
 
Posts: n/a
Default 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.

  #2  
Old July 17th, 2005, 10:49 AM
steve
Guest
 
Posts: n/a
Default 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:
http://ca.php.net/manual/en/function.fsockopen.php

--
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
  #3  
Old July 17th, 2005, 10:51 AM
Chung Leong
Guest
 
Posts: n/a
Default Re: Reading incoming HTTP data with PHP socket

"Mike Verdone" <mike.verdone@gmail.com> wrote in message
news:5487f95e.0501191347.272752f0@posting.google.c om...[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.


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.