zoukankan      html  css  js  c++  java
  • How To Fix – Mcrypt PHP extension required in Laravel on Mac OS X (No MAMP)

    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

  • 相关阅读:
    Retrofit2.0+OkHttp设置统一的请求头(request headers)
    Retrofit、Okhttp使用小记(cookie,accesstoken,POST
    quartz持久化部署实现
    支付宝支付-常用支付API详解(查询、退款、提现等)
    支付宝支付-提现到个人支付宝
    Git 版本还原命令
    CEF JS实现获取剪贴板图片的DataURL
    CEF 自定义用户协议(scheme)实现以二进制流的方式显示图片、视频、音频
    CEF C++调用前端js方法展示传递过来的图片数据
    C++读写图片数据转成Base64格式
  • 原文地址:https://www.cnblogs.com/walter371/p/4091043.html
Copyright © 2011-2022 走看看