简体   繁体   中英

php extension mcrypt must be loaded

I was following a tutorial online about installing magento on ubuntu but I get this error at the config: php extension mcrypt must be loaded . I already tried: sudo apt-get install php5-mcrypt but this didn't work for me. I had the same problem with curl but when I tried: sudo apt-get install php5-curl it did work for me. How do I fix this with mcrypt? I already tried to restart the webserver.

Hope your system is ubuntu as you added the tag.

On Ubuntu when you run sudo apt-get install php5-mcrypt it doesn't actually install the extension into the mods-available. You'll need to symlink it.

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

I am not sure why your PHP.INI is slightly different than mine. Or why I did not need to use PHP5ENMOD.

Here is how I solved the same problem:

1) Make sure it is installed on my distribution, which is not the problem most people are having.

2) Check the PHP configuration to make sure it is loaded (it was not). Here is the code for a PHP configuration info page:

<?php
phpinfo();
?>

Run it in a browser. If MCrypt is enabled (which it is NOT ), you will see a whole table dedicated to it with simmilar 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 look for the location of your PHP.INI file. for example:

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

My distribution had this file in a different location, but for linux just add or uncomment so you have:

extension=mcrypt.so

Restart your apache server to make sure. You should now check your configuration page and see the MCRYPT is loaded.

You should edit php.ini and remove the ; before the line where the extension=php_mcrypt is loaded (you should restart apache thereafter).

Hi just copy this cmd lines and paste in your terminal

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

就我而言,使用Nginx和PHP-FPM,一旦通过以下命令启用扩展功能: sudo php5enmod mcrypt我需要使用以下命令重新启动php5-fpm: sudo service php5-fpm restart

It depends on the version of the OS you're using.

UBUNTU: sudo apt-get install php-mcrypt

CENTOS: sudo yum install php-mcrypt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM