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 the password:
$this->encrypt->encode('my password');
add encrypt library
$autoload['libraries'] = array('encrypt');
and setting the secret key in config:
$config['encryption_key'] = 'nmsc encrypt secret key';
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
The Encrypt library requires the Mcrypt extension
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?
You can install Mcrypt from the PHP Source Tree as a module if you choose. Enable the module by adding: 'extension=mcrypt.so' to PHP. ini. Done!
What is mcrypt? The mcrypt extension is a replacement for the UNIX crypt command. These commands serve as a means to encrypt files on UNIX and Linux systems. The php-mcrypt extension serves as an interface between PHP and mcrypt.
You can also achieve this same screen by viewing a php file that has: phpinfo(); somewhere in the code. In this screen, simply search for the string "mcrypt support". If installed, you will see a box that says "enabled".
Best solution is (only available for CI 3 and up):
change
$this->load->library('encrypt');
to
$this->load->library('encryption');
You should install the PHP mcrypt module;
sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt
And normally you will be good ;)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With