0

I have changed mac's builtin version 5.6 of php to 7.0 which works fine but my mcrypt is not working. I have installed it using brew install mcrypt php70-mcrypt. How I can fix this issue? I am using MacOS Sierra.

  • does it say mcrypt installed successfully? isnt the command: `brew install php7.0-mcrypt`? It could be possible that brew hasn't enabled the extension. see this guys answer http://stackoverflow.com/a/35421763/6208463 – Jason Joslin Apr 12 '17 at 05:53

3 Answers3

0

First, make sure you restarted PHP. Then, at the command line, type php -v and make sure you're actually using 7.0.

If it still doesn't work make a php file and run phpinfo() and see if the extension is loading. If not, please provide any further information you can.

Difster
  • 3,264
  • 2
  • 22
  • 32
0

Have you turned on the mcrypt after installing it? You can use the following command to activate the mcrypt.

PHP5

php5enmod mcrypt

PHP7+

phpenmod mcrypt

Also, You can do this by uncommenting the line for mcrypt in php.ini.

Let me know if that helps!

Adarsh Sojitra
  • 2,059
  • 1
  • 27
  • 50
0

You need to enable the extension by editing /etc/php.ini. If this file is not present, copy /etc/php.ini.default and rename it:

sudo cp /etc/php.ini.default /etc/php.ini

Edit the /etc/php.ini file and add the following:

extension=mcrypt.so

and Restart apache

sudo apachectl restart
Shakti Phartiyal
  • 6,156
  • 3
  • 25
  • 46