Laravel 4 - Error starting `composer install`

Problem:

I installed Composer and follow the quick start guide in the Laravel 4 documentation .

When running composer install or composer update I get the following error:

 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 can not update using the composer.


Additional Information:

My PHP version on my Mac:

 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 in my case this did not work.

+7
php installation laravel laravel-4
source share
3 answers

It says:

Requires MCrypt PHP extension

So, it looks like you are missing the Mcrypt extension that Laravel requires (in fact, I think it was only used by the authentication class to handle passwords, and not for the rest of the framework components).

I don't have 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 may help you:

+5
source share

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

  • Locate the XDebug configuration file.

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

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

  • Reboot the server (Apache / Nginx / any).

     $ sudo service nginx reload 
+1
source share

You may have Mcrypt installed on your computer if you are using MAMP or any other application. This way you do not need to install Mcrypt again. Add the following code to the php file and put it in the htdocs directory. See information on running PHP. You can see if Mcrypt is installed now.

 <?php phpinfo(); 

If it shows Mcript, follow these steps:

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

where php5.5.10 is the directory of your version of PHP.

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

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

Source: Laravel requires Mcrypt PHP extension

0
source share

All Articles