You are here: exec() incomplete $output « PHP Programming Language « IT news, forums, messages
exec() incomplete $output

Posted by ajh on 12/27/06 00:54

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):

<?php

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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация