Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 4 - Error while running `composer install`

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 install or composer update:

Script php artisan optimize handling the post-install-cmd event
returned with an error...

I tried to run the following composer command:

composer create-project laravel/laravel myproject --prefer-dist

Or use their laravel.phar:

laravel new myproject

Or get the zip version from git: https://github.com/laravel/laravel?source=c

And I still fail to update via composer.


Additional information:

My PHP version on my Mac is:

PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, 
Copyright (c) 1998-2013 Zend Technologies

PHP version on MAMP: 5.4.10

I found some solutions on Google / Stack Overflow but those did not work well in my case.

like image 776
Chris So Avatar asked Dec 30 '13 13:12

Chris So


2 Answers

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/
like image 134
Damien Pirsy Avatar answered Sep 28 '22 11:09

Damien Pirsy


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
    
like image 23
X Sham Avatar answered Sep 28 '22 12:09

X Sham