Laravel requires the Mcrypt PHP extension

后端 未结 22 1961
生来不讨喜
生来不讨喜 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:20

    Just for yumers,

    yum install php-mcrypt
    service httpd restart
    chown -R apache:apache apppath
    

    Maybe you need install remi repo

    0 讨论(0)
  • 2020-11-22 08:20

    Expanding on @JetLaggy:

    After trying again and again to modify .bash_profile with the MAMP directory, I changed the file permissions for the MAMP php directory and was able to get 'which php' to show the proper directory. Trouble was that other functions didn't work, such as 'php -v'.

    So I updated MAMP. http://documentation.mamp.info/en/mamp/installation/updating-mamp

    This did the trick for my particular setup. I had to adjust my PATH to reflect the updated version of PHP, but once I did, everything worked!

    0 讨论(0)
  • 2020-11-22 08:21

    Using Ubuntu, just

    sudo php5enmod mcrypt
    

    did the trick for me. You don't need to restart Apache since you need to use PHP just from the CLI.

    0 讨论(0)
  • 2020-11-22 08:22

    in Ubuntu 14.04

    sudo apt-get install php5-mcrypt
    sudo php5enmod mcrypt
    

    Ubuntu 16.04

    sudo apt-get install php-mcrypt
    sudo phpenmod mcrypt
    

    Ubuntu 18.04

    sudo apt install php7.0-mcrypt
    sudo phpenmod mcrypt
    

    or

    sudo apt install php7.2-mcrypt
    sudo phpenmod mcrypt
    
    0 讨论(0)
  • 2020-11-22 08:23

    Do you have MAMP installed?

    Use which php in the terminal to see which version of PHP you are using.

    If it's not the PHP version from MAMP, you should edit or add .bash_profile in the user's home directory, that is : cd ~

    In .bash_profile, add following line:

    export PATH=/Applications/MAMP/bin/php/php5.4.10/bin:$PATH
    

    Edited: First you should use command cd /Applications/MAMP/bin/php to check which PHP version from MAMP you are using and then replace with the PHP version above.

    Then restart the terminal to see which PHP you are using now.

    And it should be working now.

    0 讨论(0)
  • 2020-11-22 08:23

    In Ubuntu (PHP-FPM,Nginx)

    sudo apt-get install php5-mcrypt
    

    After installing php5-mcrypt

    you have to make a symlink to ini files in mods-available:

    sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available/mcrypt.ini
    

    enable:

    sudo php5enmod mcrypt
    

    restart php5-fpm:

    sudo service php5-fpm restart
    

    More detail

    0 讨论(0)
提交回复
热议问题