473,378 Members | 1,407 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,378 software developers and data experts.

getting buffered output from exec?

Hello, I am running PHP 4 on Apache 1.31 for Fedora Core 2 Linux. I
run a process

exec("/bin/sh $my_script", $output, $return);

that takes about 15-20 seconds but produces multiple lines of output
throughout. Is there some way I can display the output as it comes
out as opposed to waiting until the process has finished and then
displaying the results?

Thanks, - Dave
Jul 17 '05 #1
2 2988
D. Alvarado wrote:
Hello, I am running PHP 4 on Apache 1.31 for Fedora Core 2 Linux. I
run a process

exec("/bin/sh $my_script", $output, $return);

that takes about 15-20 seconds but produces multiple lines of output
throughout. Is there some way I can display the output as it comes
out as opposed to waiting until the process has finished and then
displaying the results?

Thanks, - Dave


use proc_open and flush?

HTH

C.
Jul 17 '05 #2

"Colin McKinnon" <co**************@andthis.mms3.com> wrote in message
news:ck*******************@news.demon.co.uk...
D. Alvarado wrote:
Hello, I am running PHP 4 on Apache 1.31 for Fedora Core 2 Linux. I
run a process

exec("/bin/sh $my_script", $output, $return);

that takes about 15-20 seconds but produces multiple lines of output
throughout. Is there some way I can display the output as it comes
out as opposed to waiting until the process has finished and then
displaying the results?

Thanks, - Dave


use proc_open and flush?

HTH

C.


Just popen() should do. Then use fgets() to read each line.
Jul 17 '05 #3

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

Similar topics

1
by: Brian Peyton | last post by:
I need to somehow merge two separate web programs written in php together (from the user's perspective). This solution won't be perminant, I just need something done quickly. I was thinking of...
3
by: sp | last post by:
hai i have got 1. an xml file 2. an xsl file and my xsl file filters the xml based on attribute value and the output i receive is in the ordinary format
4
by: laredotornado | last post by:
Hi, What directives/headers can I add to my PHP page so that output is displayed on my HTML browser as it is received as opposed to waiting to receieve it all and then displaying it? Ideally,...
7
by: Brian Tkatch | last post by:
This is a shell question (bash), but i'm more familiar with this group, so i hope noone minds. I have a bash shell script which needs to query the database and return information into a...
1
by: John Bailo | last post by:
This is a my solution to getting an Output parameter from a SqlDataSource. I have seen a few scant articles but none of them take it all the way to a solution. Hopefully this will help some...
0
by: dusoo | last post by:
Hi all, im bit new to unix, and now im trying to get one output of one varieble in a function (ksh script), but it seems to have problems with pipe character or maybe a space. Could u please give...
3
by: EDPB | last post by:
Hi again! I need some help \ pointers on how to get the output generated in a console after you run a system command into a text widget (Perl Tk). I feel rather confident that I could get the data...
4
amarniit
by: amarniit | last post by:
I need to get this out put but i am noit getting please help me...... i need its coding 1 01 101 0101 10101 010101 1010101
0
by: nuken | last post by:
My code compiles and gives the righ output for the first output
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.