Reslove OS X composer install returned with an error - Mcrypt PHP extension required.

When I run composer install in laravel, I got this error-message

Mcrypt PHP extension required.
Script php artisan clear-compiled handling the post-install-cmd event returned with an error

  Error Output:       

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]

Upgrade PHP on OS X

Use homebrew

$ brew update
$ brew upgrade
$ brew tap homebrew/dupes
$ brew tap josegonzalez/homebrew-php
$ brew install php55

or visit to use PHP 5.5/5.4/5.3 for OS X 10.6/10.7/10.8/10.9 as binary package

Install Mcrypt PHP extension

Use Home Brew

$ brew install php55-mcrypt

Restart Apache Service

$ sudo apachectl restart

Okey, run again.

$ composer install


Edit php.ini file in OS X

$ sudo cp /private/etc/php.ini.default /private/etc/php.ini
0.00 avg. rating (0% score) - 0 votes