I am trying to use the migrate
function in Laravel 4
on OSX
. However, I am getting the following error:
Laravel requir
Just for yumers,
yum install php-mcrypt
service httpd restart
chown -R apache:apache apppath
Maybe you need install remi repo
Expanding on @JetLaggy:
After trying again and again to modify .bash_profile with the MAMP directory, I changed the file permissions for the MAMP php directory and was able to get 'which php' to show the proper directory. Trouble was that other functions didn't work, such as 'php -v'.
So I updated MAMP. http://documentation.mamp.info/en/mamp/installation/updating-mamp
This did the trick for my particular setup. I had to adjust my PATH to reflect the updated version of PHP, but once I did, everything worked!
Using Ubuntu, just
sudo php5enmod mcrypt
did the trick for me. You don't need to restart Apache since you need to use PHP just from the CLI.
in Ubuntu 14.04
sudo apt-get install php5-mcrypt
sudo php5enmod mcrypt
Ubuntu 16.04
sudo apt-get install php-mcrypt
sudo phpenmod mcrypt
Ubuntu 18.04
sudo apt install php7.0-mcrypt
sudo phpenmod mcrypt
or
sudo apt install php7.2-mcrypt
sudo phpenmod mcrypt
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 or add .bash_profile
in 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 are using and then replace with the PHP version above.
Then restart
the terminal to see which PHP you are using now.
And it should be working now.
In Ubuntu (PHP-FPM,Nginx)
sudo apt-get install php5-mcrypt
After installing php5-mcrypt
you have to make a symlink to ini files in mods-available:
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
enable:
sudo php5enmod mcrypt
restart php5-fpm:
sudo service php5-fpm restart
More detail