0

I am trying to install laravel via composer ( http://laravel.com/docs/quick#installation ) and I got stuck at the point where it requires Mcrypt extension

Mcrypt PHP extension required.

I installed Mcrypt extension using brew. But still it throws the same requirement error. I also tried changing the path as suggested here but my which php doesn't show anything other than

/usr/bin/php

Am I doing something wrong with assigning path at ~/.bash_profile? why is "which php" output still the same. and why is mcrypt installation not working on laravel workout?

Community
  • 1
  • 1
Chandan Gupta
  • 1,410
  • 2
  • 13
  • 29
  • possible duplicate of [Laravel requires the Mcrypt PHP extension](http://stackoverflow.com/questions/16830405/laravel-requires-the-mcrypt-php-extension) – leo Apr 22 '14 at 11:42
  • Have you looked at http://stackoverflow.com/questions/21762604/mcrypt-not-detected-with-laravel-installation?rq=1 and http://stackoverflow.com/questions/16830405/laravel-requires-the-mcrypt-php-extension?rq=1 ? – leo Apr 22 '14 at 11:43

2 Answers2

0

What command did you use to install mcrypt? It is possible that you try to install the mcrypt extension for the wrong php version.

Try debugging the situation with

php -v

and

ls -al /usr/bin/php

There is a different install recipe for version 5.5 and 5.4 of PHP.

brew install php54-mcrypt
brew install php55-mcrypt
hannesvdvreken
  • 4,858
  • 1
  • 15
  • 17
0

OK, I was fed up off all other solutions which weren't working, so finally downloading and compiling php from source itself worked.

So here's what I did:

  1. Download php from official site
  2. Follow following instructions

    cd to/extracted/php/folder
    cd /ext/mycript
    phpize
    ./configure
    make
    make test
    sudo make install
    

Add extension=mcrypt.so to /etc/php.ini file. Now restart the server

sudo apachectl restart

You are good to go, Cheers! :)

hannesvdvreken
  • 4,858
  • 1
  • 15
  • 17
Chandan Gupta
  • 1,410
  • 2
  • 13
  • 29