Laravel requires the Mcrypt PHP extension

后端 未结 22 1960
生来不讨喜
生来不讨喜 2020-11-22 07:59

I am trying to use the migrate function in Laravel 4 on OSX. However, I am getting the following error:

Laravel requir         


        
22条回答
  •  有刺的猬
    2020-11-22 08:25

    To those that uses XAMPP 1.7.3 and Mac

    1. Go to Terminal
    2. Enter which php
      • If it says /usr/bin/php, then proceed to 3.
    3. Enter sudo nano ~/.bash_profile (or sudo vim ~/.bash_profile if you know how to use it)
    4. Then paste this export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH"
    5. Ctrl+O then enter to save, then Ctrl+X to exit.
    6. Type cd ~
    7. type . .bash_profile
    8. restart terminal.
    9. Enter which php. If you did it right, it should be the same as the path in #4.

    The reason for the mcrypt error is because your Mac uses its native php, you need to change it to the one xampp has.

    P.S. I'd recommend using MAMP for Laravel 4 for Mac users, this issue will get resolved along with the php file info error without a sweat, and the php version of xampp is so outdated.

提交回复
热议问题