Laravel requires the Mcrypt PHP extension

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.
As far as I understand, it's already enabled (see the image below).
What is wrong, and how can I fix it?
enter image description here

Answer:

Do you have MAMP installed?
Use which PHP in the terminal to see which version of PHP you are using. If it's not the PHP version from MAMP, you should edit/add .bash_profile on the user's home directory, that is : cd ~.
In .bash_profile, add following line:
export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH
Edited: First you should use command "cd /Applications/MAMP/bin/php" to check which php version from MAMP you gonna use then replace with the php version above.
and restart the terminal to see which PHP you are using now.
And it should be working now.

To those that uses XAMPP 1.7.3 and Mac
  1. Go to Terminal
  2. Enter which php
    • If it says /usr/bin/php, then proceed to 3.
  3. Enter sudo nano ~/.bash_profile (or sudo vim ~/.bash_profile if you know how to use it)
  4. Then paste this export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"
  5. Ctrl+O then enter to save, then Ctrl+X to exit.
  6. Type cd ~
  7. type . .bash_profile
  8. restart terminal.
  9. Enter which php. If you did it right, it should be the same as the path in #4.
The reason for the mcrypt error is because your Mac uses its native php, you need to change it to the one xampp has.
P.S. I'd recommend using MAMP for Laravel 4 for Mac users, this issue will get resolved along with the php file info error without a sweat, and the php version of xampp is so outdated.
First
0 Komentar