php 错误:加密库需要在 codeigniter 中使用 Mcrypt 扩展 [英] php error: The Encrypt library requires the Mcrypt extension in codeigniter

查看:25
本文介绍了php 错误:加密库需要在 codeigniter 中使用 Mcrypt 扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个登录和注册表单,并使用加密库来加密密码..我的服务器使用 Xampp,我的系统正常工作..

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..

用于加密密码的代码:

$this->encrypt->encode('my password'); 

添加加密库

 $autoload['libraries'] = array('encrypt');

并在配置中设置密钥:

$config['encryption_key'] = 'nmsc encrypt secret key';

我的代码在 windows 中使用 xampp 服务器运行良好,但是当我尝试将我的网站上传到 ubuntu 服务器时,我收到一个错误提示

My code works well using xampp server in windows but when Im trying to upload my website to ubuntu server I've got an error says

加密库需要 Mcrypt 扩展

The Encrypt library requires the Mcrypt extension

如何解决这个问题?参考本指南 https://www.codeigniter.com/user_guide/libraries/encryption.html 但我不知道如何安装那个 mcrypt.我的网站需要从 ubuntu 服务器运行.如何安装或修复该问题?

how to fix that problem? refering this guide https://www.codeigniter.com/user_guide/libraries/encryption.html but I dont know how to install that mcrypt. my website needs to run from ubuntu server. how to install or fix that problem?

推荐答案

最佳解决方案是(仅适用于 CI 3 及更高版本):

Best solution is (only available for CI 3 and up):

改变

 $this->load->library('encrypt');

 $this->load->library('encryption');

这篇关于php 错误:加密库需要在 codeigniter 中使用 Mcrypt 扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆