i am using this code in test.php:
<?php
$con=mysql_connect('localhost','username','password');
exec("awk commend",$out);
foreach($out as $line)
{
echo $line;
}
mysql_close($con);
?>
when i use php /var/www/html/test.php
it give the result of execution. What can I do to show the result in browser?
The path of the awk program must be invalid. Check if the file exists.
If awk fails, it will probably write to stderr instead of stdout, and you're only printing stdout.
Try having this instead of what you have now:
exec("awk commend 2>&1",$out);
This will redirect stderr to stdout, so you should be able to see the error message.