Laravel 4 - Error while running `composer install`

后端 未结 3 569
离开以前
离开以前 2021-01-18 09:30

The problem:

I have installed Composer and followed the Quick start guide in the Laravel 4 documentation.

I get the following error when I run composer

相关标签:
3条回答
  • 2021-01-18 09:46

    It says:

    MCrypt PHP extension required

    So it looks like you're missing the Mcrypt extension, which is required by Laravel (actually, I think it's used only by the Authentication class for password handling, not for the rest of the components of the framework).

    I haven't got a Mac, but the command to install it should be something like this, using Homebrew

    brew tap josegonzalez/php
    brew install mcrypt php54-mcrypt
    

    These links might help you:

    • http://www.jorble.com/2013/04/install-php-mcrypt-in-macosx/
    • http://coolestguidesontheplanet.com/install-mcrypt-php-mac-osx-10-9-mavericks-development-server/
    0 讨论(0)
  • 2021-01-18 09:51

    Having the setting xdebug.scream = 1 in the configuration was the cause of the problem for me. I fixed it by doing the following:

    1. Find XDebug configuration file.

      $ sudo find / -name xdebug.ini
      
    2. Edit file using any text editor.

      $ sudo vi /your_path/xdebug.ini
      
    3. Set xdebug.scream = 0

    4. Reload the server (Apache/Nginx/whatever).

      $ sudo service nginx reload
      
    0 讨论(0)
  • 2021-01-18 10:04

    You might have Mcrypt installed already on your computer, if you are using MAMP or any other application. So, you don't need to install Mcrypt again. Add the following code to a php file and place it in your htdocs directory. See the info about the PHP you are running. You can see whether Mcrypt is already installed or not.

    <?php
    phpinfo();
    

    If it shows Mcript, then do the following:

    • Check which PHP version you are using. You can see different directories for different PHP versions in this directory: /Applications/MAMP/bin/php/.
    • Move to the user's home directory. Use this command on terminal: cd ~.
    • Edit (or create a new one if not exists) .bash_profile file.
    • Add the following line:

    where php5.5.10 is the directory of the PHP version you are using.

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

    Now restart your computer. And you can use php artisan command of Laravel.

    Source of information: Laravel requires the Mcrypt PHP extension

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