Scanning php uploads in tmp directory with clamdscan fails

Posted by Nikola on Super User See other posts from Super User or by Nikola
Published on 2012-12-14T18:20:44Z Indexed on 2012/12/16 11:10 UTC
Read the original article Hit count: 252

Filed under:
|
|
|

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?

© Super User or respective owner

Related posts about php

Related posts about apache