Laravel requires the Mcrypt PHP extension.

/ 0评 / 0

I am trying to use the migrate function in Laravel 4 on OSX, however I am getting the error

​Laravel requires the Mcrypt PHP extension.

What is wrong, and how can I fix it?

I have MAMP installed

Use which PHP in the terminal to see which version of PHP I'm using. If it's not the PHP version from MAMP, should edit/add .bash_profile on the user's home directory, that is :

cd ~

vi  .bash_profile

 add following line:

export PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH

 

Edited: First  should use command "cd /Applications/MAMP/bin/php" to check which php version from MAMP I gonna use then replace with the php version above.

and restart the terminal to see which PHP I'm using now.

And it should be working now.