设为首页 收藏本站
查看: 527|回复: 0

[经验分享] How To Fix – Mcrypt PHP extension required in Laravel on Mac OS X (No MAMP)

[复制链接]

尚未签到

发表于 2015-12-30 10:23:29 | 显示全部楼层 |阅读模式
  Laravel PHP web framework requires certain libraries to function properly. One of these libraries is the mcrypt and the php-mcrypt (bridge between mcrypt and php). However, there is a good chance that you will run into issues while running Laravel if these libraries and the extensions are not properly installed.
  When I got started with setting up Laravel on a Mac OS X Maverics development machine, i ran into this error which said: Mcrypt PHP extension required. This can be fixed easily - in two ways either by installing php54-mcrypt or the php55-mcrypt extension using homewbrew for mac or my manually compiling the php-mcrypt extension. The development machine has the pre-installed PHP on OS X maverics and not the one from a third party package installer like MAMP.
  Step 1: Install mcrypt for Mac OS X Maverics using homebrew - this command:
  sudo brew install mcrypt
  Just in case you get a brew error while running this command, this will be the cowardly refusing to sudo error from brew, fix it and try the above command again.
  Step 2: Install php-mcrypt extension using brew (based on your php version php 5.4 or php 5.5:
  sudo brew install php55-mcrypt
  or
  sudo brew install php54-mcrypt
  If you get errors like brew no available formula, then you will have to build the mcrypt extension for php manually which is a really easy step.
  After you are done with above steps, you should now no longer see the Mcrypt PHP extension required error and you are all set to start your Laravel development.
  Some sample outputs:
  Debjit-Sahas-Mac-mini:app debjit$ brew install mcrypt
==> Installing mcrypt dependency: mhash
==> Downloading https://downloads.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.t
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/mhash/0.9.9.9
==> make install
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink include/mhash.h
/usr/local/include is not writable.
  You can try again using:
brew link mhash
==> Summary
  If you encounter errors like the `brew link` step did not complete successfully or mcrypt.h not found then all you need to do is issue the following commands in your terminal:
  sudo brew link mcrypt
  if above does not work then try the following command:
  sudo brew link --overwrite mcrypt
  Once you restart Apache after following these steps, you will see the Laravel welcome message: You have arrived

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-158236-1-1.html 上篇帖子: gettext on Mac OS lion 下篇帖子: mac os x 10.7下配置svn服务器
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表