Overview
This article explains how to handle Mcrypt Error. The following error is logged after upgrade to version 4.93.0 and above:
PHP Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in /home/llaborate/my.xxxxx.co.uk/__swift/library/class.SWIFT.php:16
Stack trace:
Root Cause
- PHP 7.1+ does not support the mcrypt extension anymore.
- Kayako v4.93 uses mcrypt polyfill library.
- The polyfill library adds the functions that used to be provided by the mcrypt library but using OpenSSL instead of mcrypt.
- OpenSSL is mandatory for Kayako if you are using PHP 7 and the latest build of Kayako.
Resolution
To fix this error, you would need to edit the PHP configuration file (php.ini) on the server. Please be careful while editing the PHP configuration file as it may affect the other services sharing the same PHP configuration. Please consult your server admin to make these changes.
While you are accessing the php.ini file in edit mode, verify that
- ext-mcrypt module is disabled in PHP.ini file
- ext-openssl module is enabled in PHP.ini file
- If ext-mcrypt is disabled and ext-openssl is enabled, purge the contents of the __swift/cache folder and try again.