473,216 Members | 1,584 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,216 software developers and data experts.

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.
Jul 17 '05 #1
2 4877
"user3201" wrote:
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.


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
Jul 17 '05 #2
"Mike Verdone" <mi**********@gmail.com> wrote in message
news:54**************************@posting.google.c om...
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.


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.
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: javastudent | last post by:
Hi, I am implementing a server that reads for socket connections at a port, and processes the socket on a separate thread. We do not control the client implementation. Here is the scenario. ...
7
by: Adam Clauss | last post by:
I am trying to work-around a firewall which limits me to only being able to accept inbound connections on port 80. Unfortunately, I need to two different applications to be able to accept...
21
by: JoKur | last post by:
Hello, First let me tell you that I'm very new to C# and learning as I go. I'm trying to write a client application to communicate with a server (that I didn't write). Each message from the...
7
by: Nuno Magalhaes | last post by:
I've got a problem which relates to reading HTTP data. I've got the socket connected to a web site and then I send "GET / HTTP/1.1\n\n" and the page is received after a while but not all of the...
5
by: Dave A | last post by:
I have an application that does lots of socket communications all asynchronously via the TcpClient class. The code has been working 99.9999% of the time (yeah one of those bugs) but occasionally...
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
4
by: AviCoh | last post by:
Hi, Let me start with the question and then describe my case : Is there a way to read the raw contents of an HTTP request in PHP as a stream (i.e. not get it all at once from Apache) ? In my...
5
by: Jens | last post by:
Hello, I have been looking for some C-code which listens on a user-defined port for incoming data traffic. When data is received, the data is written to a file. I found some C-code (server)...
10
by: puzzlecracker | last post by:
Say I want to arrange bytes in the internal buffer in a certain way. I receive those bytes in the socket. One solution is to read in socket in pieces: byte buffer = new byte; int index = 0;...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.