Modify php upload tmp. Clamav access deamon cant

I am currently developing a new website that will upload and download a lot of files.

When the file is uploaded to the server, clamav will start scanning for viruses on the tmp file before it is pushed to the http server. Everything works fine except when I use clamscan and it seems like clamav needs to load the hole database before starting the scan every time and this bumps my CPU up to 50% for maybe 10-20 seconds.

This seems like a big problem, because if two users are uploading files to my site at the same time, it will probably be very slow.

So, I installed clamav deamon because it runs in the background and is already loaded with the virus database, so a lot of time and CPU power can be saved. But to the problem ...

When I use clamdscan (clamav deamon) it cannot access any of the tmp files loaded by the php script. It only works when I use clamscan. This is likely because clamdscan runs in the background and uses very strict custom permissions.

But how can I solve this? Can I change the resolution of the php tmp download file from 0600 to 0644? It's safe? Or should I change the resolution for the clamav deamon?

I really don't know how to do this, and if anyone knows and what to move, I am very grateful.


source to share

All Articles