Mailing List Archive

[clamav-users] Trying to use daemon service to scan on demand with php
Hi Team,

I have been playing with unix systems for a long time.

My current project is a web service on Ubuntu LAMP (20.02LTS).

I have installed the clamav-daemon package successfully.

My php scripts run as www-data:www-data and I have changed the user and
group in /etc/clamav/clamd.conf to www-data:www-data so that the php
library I found can access the socket and scan files when I want to. I
had to chown both the socket and log directories to get the daemon the
start.

So everything appears to be up and running.

When I trace the php library the return is always false because the
clamd service cannot read the file for scanning

eg my trace messages:

Call to scan
About to send the command
Getting socket
command:SCAN
/var/www/html/ikgn/images/uploads/Y8g31Pmwc4pp/manhattan-336708_640.jpg
recv:/var/www/html/ikgn/images/uploads/Y8g31Pmwc4pp/manhattan-336708_640.jpg:
Can't open file or directory ERROR

return:/var/www/html/ikgn/images/uploads/Y8g31Pmwc4pp/manhattan-336708_640.jpg:
Can't open file or directory ERROR

/var/www/html/ikgn/images/uploads/Y8g31Pmwc4pp/manhattan-336708_640.jpg:
Can't open file or directory ERRORCan't open file or directory ERROR
Returning false

My bafflement and the reason for this email is I have checked quite
carefully the whole path and ownership of directories and files and
cannot see why this error is being generated!

Have I missed something obvious here?

The only thing I can think of is some sort of package configuration
override but this is really grasping at straws, so any help would be
appreciated.

Thx Paul

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] Trying to use daemon service to scan on demand with php [ In reply to ]
On Sat, 23 Jan 2021, Paul Claridge wrote:

> My current project is a web service on Ubuntu LAMP (20.02LTS).
>
> I have installed the clamav-daemon package successfully.
>
> My php scripts run as www-data:www-data and I have changed the user and group
> in /etc/clamav/clamd.conf to www-data:www-data so that the php library I
> found can access the socket and scan files when I want to. I had to chown
> both the socket and log directories to get the daemon the start.

Are you using
clamdscan --fdpass
or are you trying to access the socket via php ?

With the --fdpass option, the Ubuntu defaults should be all you need.

--
Andrew C. Aitchison Kendal, UK
andrew@aitchison.me.uk

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml