The php extension mcrypt extension must be loaded

I followed an online tutorial about installing magento on ubuntu, but I get this error in config: php extension mcrypt must be loaded . I already tried: sudo apt-get install php5-mcrypt , but this did not work for me. I had the same problem with curl , but when I tried: sudo apt-get install php5-curl , it worked for me. How to fix it with mcrypt? I have already tried restarting the web server.

+7
php curl ubuntu mcrypt magento
source share
6 answers

We hope your system is ubuntu when you add the tag.

In Ubuntu, when running sudo apt-get install php5-mcrypt it does not actually install the extension in the available versions. You will need to make a symbolic link.

 sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini 

Then enable the extension and restart Apache.

 sudo php5enmod mcrypt sudo service apache2 reload 
+28
source share

I'm not sure why your PHP.INI is any different than mine. Or why I did not need to use PHP5ENMOD.

This is how I solved the same problem:

1) Make sure it is installed on my distribution, which is not a problem for most people.

2) Check your PHP configuration to make sure it is loaded (this is not the case). Here is the code for the PHP configuration page:

 <?php phpinfo(); ?> 

Launch it in a browser. If MCrypt is enabled (this is NOT), you will see a whole table devoted to this, with related information (you will see this later):

 mcrypt mcrypt support enabled mcrypt_filter support enabled Version 2.5.8 Api No 20021217 Supported ciphers cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes Supported modes cbc cfb ctr ecb ncfb nofb ofb stream Directive Local Value Master Value mcrypt.algorithms_dir no value no value mcrypt.modes_dir no value no value 

3) On the same page, find the location of your PHP.INI file. eg:

 Configuration File (php.ini) Path /etc/php5/apache2 Loaded Configuration File /etc/php5/apache2/php.ini 

My distribution had this file elsewhere, but for linux just add or uncomment so you have:

 extension=mcrypt.so 

Restart the Apache server to verify. Now you should check your configuration page and see MCRYPT loading.

+1
source share

You must edit php.ini and delete; in front of the line where extension = php_mcrypt is loaded (after that you must restart apache).

0
source share

Hi, just copy these cmd lines and paste into your terminal

 sudo apt-get install php5-intl sudo apt-get install php5-xsl sudo php5enmod xsl sudo service apache2 restart 
0
source share

In my case, using Nginx and PHP-FPM, I once enabled the extension through this command: sudo php5enmod mcrypt I need to restart php5-fpm with this command: sudo service php5-fpm restart

0
source share

It depends on the version of OS you are using.

UBUNTU: sudo apt-get install php-mcrypt

SENTOS: sudo yum install php-mcrypt

0
source share

All Articles