Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The Encrypt library requires the Mcrypt extension

I have a PHP application written using the Codeigniter framework. When I am trying to run this application on Windows Machine then I am getting below error:

An Error Was Encountered
The Encrypt library requires the Mcrypt extension.

This same application working fine on some random Windows Machine having the same configuration. I have tried on 5 different windows 10 machines and got this error on 3 Machine and worked fine on 2 machines. Here I have used the same installer to install XAMPP on all the machines and the same code, but still don't know how to make it run smoothly. I have tried almost all the suggestions available online like to make a change in php.ini but no luck so far.

like image 931
Rahul Kumar Singh Avatar asked May 26 '18 10:05

Rahul Kumar Singh


2 Answers

(FOR CI USERS only) If you are switched from CI2 XAMPP(php5) to XAMPP(php7) then, paste encrypt.php in CI->system->libraries folder, after this it should be fine !

like image 150
Pushpendra Kumar Avatar answered Sep 24 '22 21:09

Pushpendra Kumar


For the future comers, I have face this problem too. It is usually issue with php 7.2.

Simply replace encrypt with encryption in autoload.php

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

$autoload['libraries'] = array('database', 'email', 'session', '**encryption**', 'pagination');
like image 29
Abhishek Soni Avatar answered Sep 25 '22 21:09

Abhishek Soni