2

I am trying to install Laravel in my Mac Mini and have been getting error.

Error:

Writing lock file
Generating autoload files
Mcrypt PHP extension required.
Script php artisan clear-compiled handling the post-install-cmd event returned with an error



[RuntimeException]  
Error Output:       



create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [package] [directory] [version]

One month ago I had installed Laravel 4.2 and was running good. But now when I install new Larvel 4.2, Its giving the error given above.

I am using built-in PHP,mySql,phpMyAdmin.(not MAMP or XAMP)

I already have installed mcrypt extension.

Ajay Kumar Ganesh
  • 1,838
  • 2
  • 25
  • 33
Jishad
  • 2,876
  • 8
  • 33
  • 62
  • 1
    This has already been solved here: http://stackoverflow.com/questions/16830405/laravel-requires-the-mcrypt-php-extension – NickOS Apr 24 '15 at 06:23

1 Answers1

5

The web enabled extensions and command line enabled extensions can differ. Run php -m in your terminal and check to see if mcrypt is listed. If it's not then check where the command line is loading your php.ini file from by running php --ini from your terminal.

In this php.ini file you can enable the extension.

OSX

I have heard of people on OSX running in to problems due to the terminal pointing to the native PHP shipped with OSX. You should instead update your bash profile to include the actual path to your PHP. Something like this:

export PATH=/usr/local/php5/bin:$PATH

Use which PHP in the terminal to see which version of PHP you are using. If it's not the PHP version which it has to be, you should edit/add .bash_profile on the user's home directory, that is : `cd ~.

In .bash_profile, add following line:

export PATH=/usr/local/php5/bin:$PATH

Also check if the php.ini has extention=mcrypt.so enabled , and check again if mcrypt is installed properly.

Ajay Kumar Ganesh
  • 1,838
  • 2
  • 25
  • 33