Jump to content


This topic is now archived and is closed to further replies.


Can you met this problem?

Recommended Posts

Hi everyone,

i am trying this one, for one week

i am uploading some files through my php code,
i need to scan the files for virus information,

some sites they referred clamav, so i installed that one
it is working well in command line, in code, i gave like this


$e= "testphp.php";
echo "<br>";
$g= exec("clamscan \"$e\"");
echo "Res is <br>";
echo $g;

my output is

Res is
Time: 1.732 sec (0 m 1 s)

from this i can't know anything......
How can i get the virus information?

guide me! plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

with thanks

Share this post

Link to post
Share on other sites
take a look at the php manual. exec() only returns the [b]last row[/b] of the result from your external program. there are variables you can pass to retrieve the entire value of the output, but you may want to look at running passthru() instead.
$res = array();
$e = "test.php";
exec("clamscan \"$e\"", $res);
echo "Res is:<br />\n";
echo "<pre>\n";
foreach ($res as $row) echo "$row<br />\n";
echo "</pre>\n";

try that out instead, and you should have the entire result printed out in preformat tags.

good luck

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.