Question

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?

Was it helpful?

Solution 2

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! :)

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top