Reputation: 41
I'm using MAMP and ive installed a fresh version of Opencart, its telling me i dont have MCrypt enabled, when i go to terminal and type:
php -m | grep mcrypt
output: mcrypt
I can locate the library but it doesn't seem to be enabled.
Upvotes: 1
Views: 20153
Reputation: 7575
Using Brew:
brew install mcrypt
File
-> Edit Template
-> PHP (php.ini)
-> {PHP version}
Find 'Dynamic Extensions' in the text and add the following below (after the lines starting with ';'):
extension=mcrypt.so
Save, restart and test (with php -i | grep mcrypt
for example)
Upvotes: 1
Reputation: 86
I have tried so many ways but had no luck.
After a lot of trials finally came up with a solution.
Go to bin directory inside current active PHP version directory. In my case it is /Applications/MAMP/bin/php/php7.2.8/bin
It might be different in your case. Now run the below command with sudo
sudo ./pecl install channel://pecl.php.net/mcrypt-1.0.1
Now You should add extension=mcrypt.so
to php.ini
Restart MAMP Service and check if it is working.
Upvotes: 4
Reputation: 490
I had this issue following upgrading to MAMP 5.1 and using PHP 7.1.20...
The issue I found was not that MAMP PHP did not have mcrypt installed, it certainly does come bundled.
The issue was that the MAMP PHP configuration option "Make this version available on the command line" was NOT working and so the version of PHP I was using on the command line [in my case] was the macOS default PHP 7.1.16 without mcrypt (the version included in macOS by default)
Reverting to the old cli php alias meant the correct MAMP version of PHP was used on the command line
Added to .bash_profile
alias php='/Applications/MAMP/bin/php/php7.1.20/bin/php'
Upvotes: 3
Reputation: 15457
That fact that php -m | grep mcrypt
returns mcrypt
, means the mcrypt library is INSTALLED and ENABLED.
Although it may just be enabled for CLI.
You can try editing the PHP.ini file and adding the following line under the ; Extensions
section:
extension=mcrypt.so
Restart Apache / MAMP after saving php.ini file.
To find the correct php.ini
file to edit, run the following command line:
php --info | grep php.ini
(If the line already exists, you may just need to remove the ;
thats in front of it.)
Upvotes: 6