php error: The Encrypt library requires the Mcrypt extension in codeigniter

后端 未结 10 950
渐次进展
渐次进展 2020-12-10 13:30

I have a login and sign up form and use the encrypt library to encrypt the password.. I am using Xampp for my server and my system works correctly..

code to encrypt

相关标签:
10条回答
  • 2020-12-10 13:55

    Solution works for me is

    Before :

    $autoload['libraries'] = array('database','session','upload','form_validation','encrypt','pagination');
    

    After :

    $autoload['libraries'] = array('database','session','upload','form_validation','pagination');
    

    i just removed encrypt library from autoload libraries.

    0 讨论(0)
  • 2020-12-10 14:01

    I was getting this error because i had switched from XAMPP(php5) to XAMPP(php7), for this I replaced my old CI->system->libraries->encrypt.php with new file here:encrypt.php, and it worked.

    In this new file we check if mcrypt_encrypt is supported or not in __construct function with code below

       $this->_mcrypt_exists = ( ! function_exists('mcrypt_encrypt')) ? FALSE : TRUE;
    

    and based on that we use different function between mcrypt_encode and _xor_encode like that.

    Just to know, if you see this old file in __construct function you will see actual error checking

        if (($this->_mcrypt_exists = function_exists('mcrypt_encrypt')) === FALSE)
        {
            show_error('The Encrypt library requires the Mcrypt extension.');
        }
    

    It worked for me.

    0 讨论(0)
  • 2020-12-10 14:02

    You should install the PHP mcrypt module;

    sudo apt-get install php5-mcrypt
    sudo php5enmod mcrypt
    

    And normally you will be good ;)

    0 讨论(0)
  • 2020-12-10 14:04

    Sounds like you need to update your php version.

    http://php.net/manual/en/mcrypt.requirements.php
    
    0 讨论(0)
提交回复
热议问题