Symptoms
-
Fresh Prestashop installation is showing blank page;
-
The following error is shown in Domains > example.com > Logs (
/var/www/vhosts/system/logs/error_log
):mod_fcgid: stderr: PHP Fatal error: Call to undefined function mcrypt_encrypt() in /var/www/vhosts/example.com/httpdocs/prestashop/classes/Rijndael.php on line 50
-
If PHP by OS vendor is used on the domain, the following command shows no output:
# rpm -qa | grep php-mcrypt
OR
PHP 7.2 or newer is used on the domain
Cause
‘php-mcrypt’ module is not installed on the server, or it is not supported by the used PHP handler.
Resolution
If OS vendor PHP is used on the domain
-
Connect to the server via SSH;
-
Install ‘php-mcrypt’ module:
For RHEL-based OSs:
# yum install php-mcrypt
For Debian-based OSs:
# apt-get install php5-mcrypt
-
Find additional PHP
.ini
files folder:# php -i | grep “Scan this dir for additional .ini files”
Scan this dir for additional .ini files => /etc/php.d -
Add the configuration file
mcrypt.ini
to load the extension:# echo “extension=mcrypt.so” >> /etc/php.d/mcrypt.ini
If Plesk PHP 7.2 is used on the domain
Note: PHP dropped mcrypt from PHP core starting from 7.2: Moving MCrypt to PECL
-
Install the mcrypt module on Plesk PHP 7.2: How to install the php-mcrypt module on a Plesk server
OR
Change PHP version to 7.1 or older: How to change PHP settings/version for a domain in Plesk?