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

How To Fix – Mcrypt PHP extension required in Laravel on Mac OS X (No MAMP)的更多相关文章

  1. laravel提示Mcrypt PHP extension required

    系统Ubuntu 安装Apache,php后发现laravel报 Mcrypt PHP extension required错误 解决办法: apt-get install php5-mcrypt c ...

  2. ubuntu安装 laravel 过程中出现: mcrypt php extension required 的问题 | 以及composer相关问题 | Nginx安装

    这篇文章对于Nginx的配置至关重要 如果碰到访问index.php不返回html而出现下载文件的问题,加上那段default就可以修正: https://www.digitalocean.com/c ...

  3. <亲测好使>mac os 安装mcrypt扩展

    以前安装opencart的时候倒是不需要mcrypt 这个库.但是新版本需要了.加上自己的 是mac环境.当时闲麻烦,就一直没装.这次下午就寻思给装上吧! 1.首先你要先安装xcode这个工具.不然没 ...

  4. 在Mac OS X中完善PHP环境:memcache、mcrypt、igbinary

    本文环境: Mac OS X 10.8.5 Xcode 5.0 Mac OS X升级到10.8.5之后,内置的Apache升级到2.2.24,PHP升级到了5.3.26.本文以此环境为基础. 本文简介 ...

  5. How to fix the bug “Expected "required", "optional", or "repeated".”?

    参考:https://github.com/tensorflow/models/issues/1834 You need to download protoc version 3.3 (already ...

  6. 请教MAC OS下PHP的mcrypt怎么安装

    安装方法一: 通过Homebrew安装mcrypt,安装成功 [Shell] 纯文本查看 复制代码 brew install mcrypt MCrypt是一个功能强大的加密算法扩展库,它包括有22种算 ...

  7. 【转】[fix] Wireshark error: There are no interfaces on which a capture can be done. on Mac OS X

    I got the following error message when trying to open a network interface for capture using Wireshar ...

  8. Mac OS X 10.10 Yosemite PHP 5.5.14 free type support fix

    通过将php将至5.4来勉强支持freetype扩展,不推荐此方法 after upgrading to new Mac OS X Yosemite, i noticed that free type ...

  9. Fix an “Unapproved Caller” SecurityAgent Message in Mac OS X

    上午一进公司就被日本分公司的美女呼叫,说mac硬盘加密经常开机后需要输入硬盘加密密码才可以登录,我想应该是硬盘加密后没有给用户添加许可证,所以每次登录系统都要进行验证.于是远程到用户电脑上后,准备在硬 ...

随机推荐

  1. find 忽略文件夹选项-prune的说明

    注意:因为习惯在当前路径查找时候,常忽略./ 的指定,但读者不要因此而完全忘记find的格式. 查找时忽略指定目录,是要使用-prune选项,但实际上最重要的还是要和path配合.-prune的意义是 ...

  2. PHP将解析xml变为数组方法

    最近想要做一个插件机制,需要用到xml,在解析xml时候需要转换为数组,特意记录一个此种解析方式 xml文件 <?xml version="1.0" encoding=&qu ...

  3. 轻松绕过极域电子教室、和教师控制 Say GoodBye

    注意:以下博文(包括但不限于汉字.英文.阿拉伯数字 .图片.影像,以及前述之各种任意组合等等)均为随意敲击键盘所出,用于检验本人电脑键盘录入.屏幕显示的机械.光电性能,并不代表本人观点.如需要详查请直 ...

  4. Android异步下载网络图片

    最近新做的一个项目,里面需要下载网络上的图片,并显示在UI界面上,学Android有个常识,就是Android中在主线程中没法直接更新UI的,要想更新UI必须另外开启一个线程来实现,当开启的线程完成图 ...

  5. 七、Android学习笔记_JNI hello world

    1.需要准备的工具,eclipse,cdt(c++)插件,cygwin(unix)和 android ndk. 在cygwin的etc目录下将ndk的路径引入到profile文件中,可以在cygwin ...

  6. C# 线程抛异常

    异常抛出 异常抛出要在线程代码中抛出,否则捕获不到 using System; using System.Threading; namespace testthread_keyword_lock { ...

  7. C#如何关闭一个窗口的同时打开另一个窗口

    在.net的WinForm程序中,如果是直接起动的Form作为主窗口,那么这个主窗口是不能关闭的,因为它维护了一个Windows消息循环,它一旦关闭了就等于声明整个应用程序结束,所以新打开的窗口也就被 ...

  8. Warning: Permanently added '...' (RSA) to the list of known hosts --Windows下git bash 警告处理

    原链接地址 StackOverflow 处理方法: 创建文件~/.ssh/config, 此处对应windows当前用户目录下的.ssh文件夹 增加如下语句 UserKnownHostsFile ~/ ...

  9. Exchange之证书申请

          1.         打开EMC,选择服务器配置,然后右击新建证书   2.         输入一个好记的名称   3.         这里申请通配符证书   4.         填 ...

  10. 64位系统下注册32位dll文件

    64位系统下注册32位dll文件 在64位系统里注册32位软件所需的一些dll会提示不兼容,大概因为32 位进程不能加载64位Dll,64位进程也不可以加载32的导致. 若要支持的32 位和64 位C ...