<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>php-clamav &#8211; Arun&#8217;s blog</title>
	<atom:link href="https://arunns.net/tag/php-clamav/feed/" rel="self" type="application/rss+xml" />
	<link>https://arunns.net</link>
	<description>Arun&#039;s blog</description>
	<lastBuildDate>Sat, 20 Apr 2013 12:29:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.2</generator>
	<item>
		<title>Virus scanning for file uploads with clamav/php</title>
		<link>https://arunns.net/virus-scanning-for-file-uploads-with-clamavphp/</link>
					<comments>https://arunns.net/virus-scanning-for-file-uploads-with-clamavphp/#comments</comments>
		
		<dc:creator><![CDATA[Arun N.]]></dc:creator>
		<pubDate>Sat, 20 Apr 2013 12:29:44 +0000</pubDate>
				<category><![CDATA[Clamav]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[integrate antivirus with uploads]]></category>
		<category><![CDATA[LibClamAV Error: cl_load(): Can't get status of /var/lib/clamav]]></category>
		<category><![CDATA[php-clamav]]></category>
		<guid isPermaLink="false">http://arunnsblog.com/?p=751</guid>

					<description><![CDATA[Download and install the following packages, in case your repository has those package just use the management tool to install. Ubuntu/Debian/Mint # apt-get install clamav clamav-db clamd clamav-devel php-devel Redhat # yum install php-devel # wget http://pkgs.repoforge.org/clamav/clamav-0.97.7-1.el5.rf.i386.rpm # wget http://pkgs.repoforge.org/clamav/clamav-db-0.97.7-1.el5.rf.i386.rpm # wget http://pkgs.repoforge.org/clamav/clamd-0.97.7-1.el5.rf.i386.rpm # wget http://pkgs.repoforge.org/clamav/clamav-devel-0.97.7-1.el5.rf.i386.rpm # rpm -Uvh clam* # freshclam # service clamd [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Download and install the following packages, in case your repository has those package just use the management tool to install.</p>
<p>Ubuntu/Debian/Mint</p>
<blockquote><p># apt-get install clamav clamav-db clamd clamav-devel php-devel</p></blockquote>
<p>Redhat</p>
<blockquote><p># yum install php-devel<br />
# wget http://pkgs.repoforge.org/clamav/clamav-0.97.7-1.el5.rf.i386.rpm<br />
# wget http://pkgs.repoforge.org/clamav/clamav-db-0.97.7-1.el5.rf.i386.rpm<br />
# wget http://pkgs.repoforge.org/clamav/clamd-0.97.7-1.el5.rf.i386.rpm<br />
# wget http://pkgs.repoforge.org/clamav/clamav-devel-0.97.7-1.el5.rf.i386.rpm<br />
# rpm -Uvh clam*<br />
# freshclam<br />
# service clamd start</p></blockquote>
<p><strong>Configure php-clamav</strong></p>
<p>Download php-clamav from from sf.net</p>
<blockquote><p># wget http://downloads.sourceforge.net/project/php-clamav/0.15/php-clamav_0.15.7.tar.gz<br />
# tar xvzf php-clamav_0.15.7.tar.gz<br />
# cd php-clamav-0.15.7/<br />
# phpize<br />
#./configure &#8211;with-clamav<br />
# make<br />
# cp modules/clamav.so /usr/lib/php/modules/</p></blockquote>
<p>Add the modules to php.ini if required.</p>
<blockquote><p>extension=clamav.so</p></blockquote>
<p>Make sure the module is loaded</p>
<blockquote><p># php -i | grep -i clam<br />
clamav</p></blockquote>
<p>Incase you see the following error create a symlink to clamav path<br />
LibClamAV Error: cl_load(): Can&#8217;t get status of /var/lib/clamav</p>
<blockquote><p># ln -s /var/clamav /var/lib/clamav</p></blockquote>
<p>Test script<br />
Get the testing virus file from http://www.eicar.org/86-0-Intended-use.html and save it on a file (eg: /tmp/virus.txt)</p>
<p>Create a php script:<br />
cat &gt; check_virus.php<br />
<!--?php $file = '/tmp/virus.txt'; $retcode = cl_scanfile($file, $virusname); if ($retcode == CL_VIRUS) { echo ."Virus found name : ".$virusname; } else { echo .cl_pretcode($retcode); } ?--></p>
<blockquote><p>&lt;?php<br />
$file = &#8216;/tmp/testing.txt&#8217;;<br />
$retcode = cl_scanfile($file, $virusname);<br />
if ($retcode == CL_VIRUS) {<br />
echo .&#8221;Virus found name : &#8220;.$virusname;<br />
} else {<br />
echo .cl_pretcode($retcode);<br />
}<br />
?&gt;</p>
<p>$ php check_virus.php<br />
Virus found name : Eicar-Test-Signature</p></blockquote>
<p>./arun</p>
]]></content:encoded>
					
					<wfw:commentRss>https://arunns.net/virus-scanning-for-file-uploads-with-clamavphp/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
