#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    13
    Rep Power
    0

    Php-clamav not working


    Hi

    I have installed php-clamav on the latest CentOS but it does not appear to be working. phpinfo() shows a clamav section but its empty.

    Also $retcode=cl_scanfile($file,$virus) returns an empty variable.

    Can any one offer advice?

    Thanks

    Obfuscated Shadow
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    275
    Do you have ClamAV installed?
    I'm guessing that the php-clamav is just an "extension" to use with ClamAV and that you need ClamAV installed to make it function.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    13
    Rep Power
    0
    Originally Posted by DonR
    Do you have ClamAV installed?
    I'm guessing that the php-clamav is just an "extension" to use with ClamAV and that you need ClamAV installed to make it function.
    Hi

    Thanks for response. Clamav is installed and i can scan files from the CLI.

    If I use shel_exec then clamav will run but not scan the file. I'll get "Files scanned: 0" in the report, even though I hardcode the path to the files. Scanning the same file from the CLI works fine.

    -OS
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    275
    do you get output if you run this?
    PHP Code:
    $ret cl_info(); 
     echo 
    $ret
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    13
    Rep Power
    0
    Originally Posted by DonR
    do you get output if you run this?
    PHP Code:
    $ret cl_info(); 
     echo 
    $ret
    Hi DonR

    No its empty.
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    275
    Did you follow these INSTALL instructions?
    Code:
    1. ClamAV (http://www.clamav.net) must be installed and tested.
    
    2. php-clamav Installation:
    
    tar xvzf php-clamav-0.XX.tar.gz
    cd php-clamav-0.XX
    phpize
    ./configure --with-clamav
    make  
    cp modules/clamav.so /usr/local/lib/php/extensions/
    (restart Apache)
    service httpd restart
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    13
    Rep Power
    0
    Originally Posted by DonR
    Did you follow these INSTALL instructions?
    Code:
    1. ClamAV (http://www.clamav.net) must be installed and tested.
    
    2. php-clamav Installation:
    
    tar xvzf php-clamav-0.XX.tar.gz
    cd php-clamav-0.XX
    phpize
    ./configure --with-clamav
    make  
    cp modules/clamav.so /usr/local/lib/php/extensions/
    (restart Apache)
    service httpd restart
    I have. Are there any tests I can run to check the success of the steps above? I have already used get_loaded_extensions() to check and clamav appears on the list. But as stated before in phpinfo() I only get a clamav heading with nothing under it.

    Thanks for helping.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Oct 2009
    Location
    Nebraska, USA
    Posts
    876
    Rep Power
    275
    That php-clamav pkg has a file called "phpclamav-test.php" with it.

    Have you tried running that?
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    13
    Rep Power
    0
    Originally Posted by DonR
    That php-clamav pkg has a file called "phpclamav-test.php" with it.

    Have you tried running that?
    This is the output from it:

    Functions available in the test extension :
    cl_info
    cl_scanfile
    cl_engine
    cl_pretcode
    cl_version
    cl_debug



    cl_info() return :
    cl_version() return :
    cl_pretcode(CL_CLEAN) return : virus not found
    cl_pretcode(CL_VIRUS) return : virus found
    Execution time : 0.00044083595275879 seconds
    File path : /var/www/USB.zip
    Return code : virus not found

IMN logo majestic logo threadwatch logo seochat tools logo