can't find mcrypt => Call to undefined function Laravel\mcrypt_create_iv()

前端 未结 10 1833
刺人心
刺人心 2020-12-29 01:04

Trying to set up Laravel and keep getting hit with this error. I installed mcrypt through brew and it is located in /usr/local/Cellar. Any thoughts? .. It\'s not showing up

10条回答
  •  抹茶落季
    2020-12-29 01:46

    You've installed mcrypt when you actually wanted the php56-mcrypt php module.

    You stated in your question that you can see mcrypt installed in /usr/local/Cellar and that you're using OSX. So, the easiest way to install the mcrypt PHP module on OSX using Homebrew is:

    // assuming you have php56
    brew install php56-mcrypt
    

    If homebrew can't find the correct package you may need to tap the PHP repositories found on GitHub:

    brew tap homebrew/dupes
    brew tap homebrew/versions
    brew tap homebrew/homebrew-php
    

    Now when you issue the command brew search mcrypt, you should see something like:

    libtomcrypt   mcrypt   php53-mcrypt   php54-mcrypt   php55-mcrypt   php56-mcrypt
    

    Several other posters have mentioned the need to edit your php.ini file. This will be unnecessary as homebrew will take care of activating the module for you. It places the configuration file at /usr/local/etc/php/5.6/conf.d/ext-mcrypt.ini

提交回复
热议问题