我有一个登录和注册表单,并使用加密库来加密密码。我正在为我的服务器使用 Xampp,我的系统工作正常。
加密密码的代码:
$this->encrypt->encode('my password');
添加加密库
$autoload['libraries'] = array('encrypt');
并在配置中设置 key :
$config['encryption_key'] = 'nmsc encrypt secret key';
我的代码在 Windows 中使用 xampp 服务器运行良好,但是当我尝试将我的网站上传到 ubuntu 服务器时,出现错误提示
The Encrypt library requires the Mcrypt extension
如何解决这个问题?引用本指南 https://www.codeigniter.com/user_guide/libraries/encryption.html但我不知道如何安装那个 mcrypt。我的网站需要从 ubuntu 服务器运行。如何安装或修复该问题?
最佳答案
最佳解决方案是(仅适用于 CI 3 及更高版本):
改变
$this->load->library('encrypt');
到
$this->load->library('encryption');
关于PHP 错误 : The Encrypt library requires the Mcrypt extension in codeigniter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35798048/