data streaming

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Tue Sep 07, 2004 8:29 am

I am trying (for some server apps) to create a "web-installer" with PHP. For that reason i looking for a way of streaming data from the server to the browser. An example:

A php script contains the command system("/usr/local/apache-1.3.31/configure ; make ; make install"); . While the installation runs on the server I want to have the same data shown on the web page but... without buffering (all together at the end of install), like SSH on real time. Is that possible?

I have read some few texts saying that this can be done with php as CGI.. any ideas? Has anyone ever tried this?
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6


Mike Vassileiou
[Systems Administrator / PHP Developer]


PHP/MySQL Manual:
http://www.phpmysql-manual.com

User avatar
ruturajv
php-forum Super User
php-forum Super User
Posts: 1279
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India
Contact:

Tue Sep 07, 2004 8:59 pm

I don't understand...
How can you install php/apache "make ... make installl apache"
using php... I mean you have to compile php first before using it...
You rather need Perl... which generally comes precompiled on Linux box
and use perl to create installation scripts

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Wed Sep 08, 2004 2:19 am

No no... its not about an installation, this is only an example. I am trying to find a way of streaming data in a browser on real time and not with buffering. Any ideas?
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6


Mike Vassileiou
[Systems Administrator / PHP Developer]


PHP/MySQL Manual:
http://www.phpmysql-manual.com

User avatar
gesf
Moderator
Moderator
Posts: 1716
Joined: Sun Dec 29, 2002 5:03 am
Location: Portugal / Sweden
Contact:

Wed Sep 08, 2004 11:37 am

You mean a... 'Telnet simulation' !?
Sincerely,
Gonçalo "gesf" Fontoura

User avatar
mike
New php-forum User
New php-forum User
Posts: 73
Joined: Sun May 04, 2003 4:26 am
Location: Athens
Contact:

Wed Sep 08, 2004 2:06 pm

Not really... just the broadcast "way". I want to have a php script that can "stream" data to the browser in real time. Eg: suppose you run a script like this:

system("./install-a-program");

If this command is executed in SSH an installation proccess will begin the proccess will be shown in your screen. This is done in real time... but if this command is executed by PHP through a web-server, the whole proccess will be shown on the page at the end of installation. This happens because a socket is opened by the web-server and trasmit the result at once (the buffer). I want to stream the result until is finished and not buffer it and send it at once. Have I confused you? :( I know its really hard but I believe there is way of doing that...
11:16am up 404 days, 2 users, load average: 148.68, 143.45, 132.6


Mike Vassileiou
[Systems Administrator / PHP Developer]


PHP/MySQL Manual:
http://www.phpmysql-manual.com

Post Reply