So I started installing each of the modules you listed which I didn't have, and I think clamavlib is the culprit. What happens, I believe, is that php5-libclamav will load the signature database when PHP is called from the command line. I think the library was written to be used with Apache which should load the db only when Apache starts or the db is updated programatically.
Anyway, can you test this by commenting the following lines in /etc/php5/cli/php.ini:
#extension=clamav.so
#[clamav]
#clamav.dbpath=/var/lib/clamav
#clamav.maxreclevel=0
#clamav.maxfiles=0
#clamav.archivememlim=0
#clamav.maxfilesize=0
#clamav.maxratio=0
Then rerun the script from the CLI? When I commented the lines the test script you posted above executed at normal speed.
So I started installing each of the modules you listed which I didn't have, and I think clamavlib is the culprit. What happens, I believe, is that php5-libclamav will load the signature database when PHP is called from the command line. I think the library was written to be used with Apache which should load the db only when Apache starts or the db is updated programatically.
Anyway, can you test this by commenting the following lines in /etc/php5/ cli/php. ini: clamav. so dbpath= /var/lib/ clamav maxreclevel= 0 maxfiles= 0 archivememlim= 0 maxfilesize= 0 maxratio= 0
#extension=
#[clamav]
#clamav.
#clamav.
#clamav.
#clamav.
#clamav.
#clamav.
Then rerun the script from the CLI? When I commented the lines the test script you posted above executed at normal speed.
Thanks