Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Dec 2007 09:21:32 -0500
From:      Attos <attos.janus@gmail.com>
To:        jekillen <jekillen@prodigy.net>, freebsd-ports <freebsd-ports@freebsd.org>
Subject:   Re: PHP ClamAV Lib
Message-ID:  <5297d6fd0712030621l25916c7et9fe487b76c557dd4@mail.gmail.com>
In-Reply-To: <4751A84A.2070007@infracaninophile.co.uk>
References:  <ef3d0167b9c7aa051e2fd98dffc961db@prodigy.net> <4751A84A.2070007@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
You can execute ClamAV from PHP and parse the result.
The exec() function can do the job. This is the description from the PHP manual:

exec
(PHP 3, PHP 4, PHP 5)

exec -- Execute an external program
Description
string exec ( string command [, array &output [, int &return_var]] )


exec() executes the given command.

Parameters


command
The command that will be executed.

output
If the output argument is present, then the specified array will be
filled with every line of output from the command. Trailing
whitespace, such as \n, is not included in this array. Note that if
the array already contains some elements, exec() will append to the
end of the array. If you do not want the function to append elements,
call unset() on the array before passing it to exec().

return_var
If the return_var argument is present along with the output argument,
then the return status of the executed command will be written to this
variable.


Return Values
The last line from the result of the command. If you need to execute a
command and have all the data from the command passed directly back
without any interference, use the passthru() function.

To get the output of the executed command, be sure to set and use the
output parameter.

Examples
Example 1. An exec() example

<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
?>







On Dec 1, 2007 1:30 PM, Matthew Seaman <m.seaman@infracaninophile.co.uk> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> jekillen wrote:
> > Hello:
> > I am looking for PHP ClamAV Lib
> > in ports and I do not know of hand
> > where to find it.  I did not find it in
> > /usr/ports/security. And if it exists in
> > ports, what would it be called for a
> > find command?
> > My aim is to use it for scanning files
> > uploaded to web sites in php scripts.
> > I installed ClamAV,  Amavisd-new,
> > and Cyrus-sasl-saslauthd
> > from /usr/ports/security.
> > FreeBSD v 6.2
> > Thanks in advance
> > Jeff K
>
> Unfortunately it seems that you are not in luck.  There does
> not appear to be a PHP related ClamAV module in the ports.  Apache,
> Perl or python, yes.  PHP, no.
>
> happy-idiot-talk:/usr/ports:% make search name=clamav display=name,path
> Port:   p5-Mail-ClamAV-0.20
> Path:   /usr/ports/mail/p5-Mail-ClamAV
>
> Port:   clamav-0.91.2_1
> Path:   /usr/ports/security/clamav
>
> Port:   clamav-devel-20071011
> Path:   /usr/ports/security/clamav-devel
>
> Port:   p5-File-Scan-ClamAV-1.8_1
> Path:   /usr/ports/security/p5-File-Scan-ClamAV
>
> Port:   py25-clamav-0.4.0_1
> Path:   /usr/ports/security/py-clamav
>
> Port:   mod_clamav-0.21_1
> Path:   /usr/ports/www/mod_clamav
>
> Perhaps you could view this as your chance to contribute something
> back to the project.  Take a gander at the Porter's Handbook --
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/index.html
> and look at some of the proir art already in the ports system and
> see if you can't put together a pecl-clamav or pear-ClamAV port.
>
> Submit it via send-pr so that all can share.
>
>         Cheers,
>
>         Matthew
>
> - --
> Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
>                                                   Flat 3
> PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
>                                                   Kent, CT11 9PW
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.4 (FreeBSD)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHUahK8Mjk52CukIwRCGhQAJ4zey/5RU44g2sYGpSg12GYJeSITACePjOH
> UQOX7vLvDVuk5nRchPyWBR4=
> =gW4S
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> freebsd-ports@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-ports
> To unsubscribe, send any mail to "freebsd-ports-unsubscribe@freebsd.org"
>



-- 
Attos Janus



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5297d6fd0712030621l25916c7et9fe487b76c557dd4>