如何在CENTOS上安装PHP clamav [英] How to install PHP clamav on CENTOS

查看:329
本文介绍了如何在CENTOS上安装PHP clamav的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的是一个新手与linux,我需要安装clamav要使用php。我该怎么办呢?请逐步记下每个安装,因为我已经尝试谷歌如何安装clamav,大多数我只能安装clam av正确,但不是php包,或缺少依赖项,或沿该地区的东西。谢谢

解决方案

您只需要安装ClamAV就像正常(使用epel回购)...

  yum install clamav 
yum install clamav-devel

如果你没有EPEL,你可以从IUS社区得到它(如果你想你也可以抓住IUS repo并获得最新版本的PHP) - 谢谢RackSpace工程师为此!

  wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/ 6 / x86_64 / epel-release-6-5.noarch.rpm 
rpm -ivh epel-release-6-5.noarch.rpm

然后,您下载并安装查找其他功能


I'm really a newbie with linux, and I need to install clamav to be used on php. How can I do it? please write down step by step for each installation, as I have tried google how to install clamav, and most of them I can only either install clam av correctly, but not the php package, or missing dependencies, or something along that area. Thank you

解决方案

You just need to install ClamAV like normal (with the epel repo)...

yum install clamav
yum install clamav-devel

If you don't have EPEL you can get it from IUS community (if you want you can also grab the IUS repo and get the latest version of PHP) - thank the RackSpace engineers for this!

wget http://dl.iuscommunity.org/pub/ius/stable/CentOS/6/x86_64/epel-release-6-5.noarch.rpm
rpm -ivh epel-release-6-5.noarch.rpm

Then you download and install this library, which will handle all the hard things for you.

wget **the direct link you got**
tar -xvzf php-clamav_0.15.7.tar.gz
cd php-clamav-0.15.7
phpize
./configure
make
make install

Now add the extension to your /etc/php.ini

extension=/usr/lib64/php/modules/clamav.so

Remember to change the path to what was given to you by make install

then restart your Apache

service httpd restart

Make a file with the contents:

<?php
    echo cl_info();

It should come up with something like this:

Now you should have access to all the library functions, you can now scan files like this:

$retcode = cl_scanfile($file, $virus_name);

if ($retcode === CL_VIRUS)
{
    echo "Virus Detected! {$virus_name}";
}

Congratulations! You can find other functions here

这篇关于如何在CENTOS上安装PHP clamav的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆