Laravel requires the Mcrypt PHP extension

2018-12-31 09:21发布

I am trying to use the migrate function in Laravel 4 on OSX. However, I am getting the following 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

22条回答
初与友歌
2楼-- · 2018-12-31 09:56

Or, use:

sudo apt-get install php5-mcrypt

not sure if this will work on standard PHP installs - I installed php 5.5.7 using the package from :

sudo add-apt-repository ppa:ondrej/php5 
sudo apt-get update
查看更多
十年一品温如言
3楼-- · 2018-12-31 09:56

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!

查看更多
骚的不知所云
4楼-- · 2018-12-31 09:57

For non MAMP or XAMPP users on OSX (with homebrew installed):

brew install homebrew/php/php56-mcrypt

Cheers!

查看更多
梦寄多情
5楼-- · 2018-12-31 09:57

Just for yumers,

yum install php-mcrypt
service httpd restart
chown -R apache:apache apppath

Maybe you need install remi repo

查看更多
登录 后发表回答