Bert Carremans
Bert Carremans

Reputation: 1733

Error installing Laravel 4 with composer

When I try to install Laravel 4 via Composer, I get the following message in Terminal

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

The PHP version on my computer is 5.5.3 and when I run phpinfo it shows that mcrypt is enabled. When I run the which php command in Terminal it shows

/usr/bin/php

I therefore extended the $PATH with .bash_profile.

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

Unfortunately, the which php command still shows /usr/bin/php after extending $PATH. And as a result the error is still there. So I am out of ideas on how to solve this issue. Does anyone have an idea? Thanks!

Upvotes: 0

Views: 819

Answers (1)

Duikboot
Duikboot

Reputation: 1101

  1. There is difference between the MAMP PHP version and you "Terminal" PHP version. Therefore are you probably setting up the export path.
  2. When you are changing the export path you have to restart your terminal before it will take effect on your computer.
  3. I am not sure of this but when your error is appearing and older version of Laravel will be installed.

What do you get when you execute: php -v in your terminal?

Upvotes: 1

Related Questions