Scanning php uploads in tmp directory with clamdscan fails
- by Nikola
I can't seem to get this thing to work, some permission problem maybe, but i can't even run clamdscan normally form console with root the result is always Permission denied. for example i create a file test.txt (eicar file) in /tmp and execute "clandscan /tmp/test.txt" in console logged in as root and i get "/tmp/test.txt: Access denied. ERROR ". The clamd demon is running with user clamav could that be the reason?
Now i want to scan the same file (/tmp/test.txt) via php , so i run (i have chowned the file to apache:apache )
$cmd="clamdscan /tmp/test.txt";
exec($cmd,$a,$b);
i get error 127 i try with the full path of the command /usr/bin/clamdscan i get error 126 (command is found but is not executable), this means that apache doesn't have the permission to execute /usr/bin/clamdscan ?
what could be the problem?