exec() incomplete $output

Using Ubuntu 5, Apache2 and PHP 4 I am trying display in a web browser
the output from a program I wrote in C.

Here is an abridged version of my code (I can post all of it later):


exec( "myProg -a paramA -b paramB", $output);

print "<p>Returned: $return</p>";

foreach ( $output as $val ) {
print "$val<br />";


The problem is that in the web browser only the first two lines of the
$output appear when there should almost always more than that (usually
around 10).

I have done a test with php CLI using the same code as above: php -f
mycode. The right/expected ouput comes out here.

Any ideas how this different behaviour might be happening? Wondering if
there is some default limit on the number of lines displayed by php in
the browser... or if the actual lines are too long (but 100 chars isn't
too much is it?). Thanks.


Relevant Pages

  • Re: The Inquirer
    ... >>I could write a compiler for an arbitrary language and put this to open ... > Now go to the url with whatever web browser your using. ... PHP is open source. ... that the actual source code that makes ...
  • [Full-Disclosure] Re: Advanced XSS paper and semi-new attack
    ... * Many environments (PHP, Perl+CGI.pm) accept both POSTed and GETted data. ... browser start fetching a URL as soon as the web browser sees it, ... server but which immediately redirects to a mail sending script at your server. ...
  • Re: printing for dot matrix printers
    ... I'm looking a solutions dotmatrix printer solution for php. ... I need print a form or invoice to dotmatrix printer in browser. ... All major web browser know how to print a web page to ... If you want to ensure it prints in the way you want it to (as in an invoice), pdf is the way to go. ...
  • Re: how to run scripts after a page has already loaded and been sent to a users browser?
    ... It's because PHP is a server side scripting language, ... do stuff before you send stuff to user's web browser. ... > echo "Here is the number of times this page has been viewed: ...
  • Re: Access linux server from window
    ... > Right now I can't run php program on my machine. ... > web browser only get wrong message. ... html mail or attachments will go in the spam ...