ClamAV is a free antivirus that you can use on your website for scanning files, you can use ClamAV to scan also uploaded files using PHP below is the procedure for the installation, take note that you must have a \'root\' access to your server in order to do this.

Download the latest ClamAv from, the latest version during I wrote this procedure is version 0.95.3

#tar -xvzf clamav-0.95.3.tar.gz 
#cd clamav-0.95.3 #groupadd clamav
#useradd clamav
#make install 
#cd ..

After the installation when there is no error, you may run and test ClamAv

#clamscan -r -l scan.txt clamav-0.95.3

Updating the Database virus definition

#touch /var/log/clam-update.log
#chmod 600 /var/log/clam-update.log
#chown clamav /var/log/clam-update.log
#freshclam -d -c 6 -l /var/log/clam-update.log

Now you are ready to use ClamAV to your PHP script below is my sample script to scan files on my site, you can use the from its a test virus file but its harmless.

$output = shell_exec("/usr/local/bin/clamscan ".$filetoscan);
echo $output;
if (eregi('FOUND', $output)) {
    echo "Virus found on the file!"
    echo "no virus and file is safe"

Ok hopefully this is useful to you, on my case I use VPS Linux RedHat and I don\'t get any error during installation, I just posted it here for my own reference only