Jump to content
X2Community Forums

ClamAV - Issues with enabling "scan uploads"

Recommended Posts



I've been trying to use the Antivirus scanning utility. I installed ClamAV and can run a scan via cpanel. However, when I enable "Scan uploads" in X2CRM, when I try uploading a logo for example I get the error:

Error Code: 500
Error Message: Unable to perform anti virus scan; the "clamscan" utility is not available on this system.
Stack Trace: [click to toggle display]
X2Engine Version: 6.9
PHP Version: 5.6.31


Any ideas?

Link to post
Share on other sites
  • 3 weeks later...
  • 2 months later...

I have a similar error.


Error Code: 500
Error Message: Unable to perform anti virus scan; the "clamscan" utility is not available on this system.
Stack Trace:

CException in /home/xxxx/public_html/protected/components/behaviors/ClamScanBehavior.php(69)
#0 /home/xxxx/public_html/framework/base/CComponent.php(261): ClamScanBehavior->clamScan()
#1 /home/xxxx/public_html/framework/db/ar/CActiveRecord.php(227): CComponent->__call('clamScan', Array)
#2 /home/xxxx/public_html/protected/modules/media/models/Media.php(215): CActiveRecord->__call('clamScan', Array)
#3 /home/xxxx/public_html/framework/db/ar/CActiveRecord.php(1074): Media->beforeSave()
#4 /home/xxxx/public_html/protected/models/X2Model.php(1601): CActiveRecord->insert(NULL)
#5 /home/xxxx/public_html/protected/models/X2Model.php(898): X2Model->insert(NULL)
#6 /home/xxxx/public_html/protected/controllers/AdminController.php(3524): X2Model->save()
#7 /home/xxxx/public_html/framework/web/actions/CInlineAction.php(49): AdminController->actionUploadLogo()
#8 /home/xxxx/public_html/framework/web/CController.php(308): CInlineAction->runWithParams(Array)
#9 /home/xxxx/public_html/framework/web/filters/CFilterChain.php(133): CController->runAction(Object(CInlineAction))
#10 /home/xxxx/public_html/protected/controllers/AdminController.php(730): CFilterChain->run()
#11 /home/xxxx/public_html/framework/web/filters/CInlineFilter.php(58): AdminController->filterClearCache(Object(CFilterChain))
#12 /home/xxxx/public_html/framework/web/filters/CFilterChain.php(130): CInlineFilter->filter(Object(CFilterChain))
#13 /home/xxxx/public_html/framework/web/CController.php(291): CFilterChain->run()
#14 /home/xxxx/public_html/framework/web/CController.php(265): CController->runActionWithFilters(Object(CInlineAction), Array)
#15 /home/xxxx/public_html/framework/web/CWebApplication.php(282): CController->run('uploadLogo')
#16 /home/xxxx/public_html/framework/web/CWebApplication.php(141): CWebApplication->runController('admin/uploadLog...')
#17 /home/xxxx/public_html/framework/base/CApplication.php(185): CWebApplication->processRequest()
#18 /home/xxxx/public_html/index.php(64): CApplication->run()
#19 {main}

X2Engine Version: 6.9.3
PHP Version: 7.0.26


Now I am running this on a cPanel/CentOS system, and have just verified that ClamAV is installed.

Link to post
Share on other sites
  • 4 years later...

I know this is late (today is June of 2022), however, if you are getting this error it's because X2 is looking for the clamscan command in the wrong location. For example mine was located at /usr/local/cpanel/3rdparty/bin/clamscan

To fix this I had to modify /protected/components/behaviors/ClamScanBehavior.php

line 64 - $testProc = proc_open('clamscan --help', $descriptor, $pipes);


        $testProc = proc_open('/usr/local/cpanel/3rdparty/bin/clamscan --help', $descriptor, $pipes);

Once I did that, it worked! I wish X2 would give you the ability to configure this in the app instead of having to modify core files. BTW I am running v8.3.

Hope this helps someone else

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...