How to solve Laravel requires php mcrypt extension

2019-06-08 03:08发布

I searched the net, I followed the instructions to solve this problem but I could not solve it, when I want to use Laravel php artisian it gives errors like this:

Laravel requires php Mcrypt extenstion.

Note: I am using MAMP in Mac

please give example and solution for mac with MAMP.

2条回答
走好不送
2楼-- · 2019-06-08 03:18

It's quite possible that your command-line PHP isn't the same that MAMP is using, but rather the one that came with OSX. To find out, you can open your terminal and type php -i | grep php.ini, which will show you what ini file you're using.

If this is the case, which seems likely, you can follow the steps of older SO posts such as this one to create a symlink or overwrite the default PHP.

Alternatively, you can upgrade your system's PHP using Homebrew, for instance. I'm running 5.5.8 on my Macs, and it's working great. Do note that I do not necessarily recommend this, though, as configuring MAMP to use the new version isn't a fun experience. Also note that if you do this, you'll have to install both PHP and Mcrypt through Homebrew.

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-06-08 03:39

I had a similar issue on Ubuntu 12.04. What version of PHP are you running and does Mcrypt show up as active when you run:

<?php
phpinfo()?
?>
查看更多
登录 后发表回答