Question

When I try to update my composer for Laravel 4 I run into an issue in my terminal. I keep getting "Laravel requires the Mcrypt PHP extension."

When I double check my installment it shows that my mcrypt is already installed.

Rachaels-MacBook-Pro-2:DRCSports rachaelhill$ brew upgrade mcrypt
Error: mcrypt-2.5.8 already installed
Rachaels-MacBook-Pro-2:DRCSports rachaelhill$ brew upgrade php54-mcrypt
Error: php54-mcrypt-5.4.15 already installed

When research google for similar issues I've found is that it's, because my command line is using a different PHP and I just need to enable mcrypt. So I was advise to fix this was to run in terminal...

/usr/bin/env php --ri mcrypt

But when doing so the output I received was, "Extension 'mcrypt' not present".

I have looked at many similar issues and try to find a way to fix this through google, but I'm clearly just not doing something right. Someone please help, so I can continue on with my project. Thank you!

Was it helpful?

Solution

This is the site I used to fix my issue. Even though I had added extension=mcrypt.so to my php.ini I also had to go back and add extension_dir = "/usr/lib/php/extensions/no-debug-non-zts-20090626/". The link below will show you step by step,but what I needed was at the very end of it.

http://www.coolestguyplanettech.com/how-to-install-mcrypt-for-php-on-mac-osx-lion-10-7-development-server/

OTHER TIPS

The system's PHP binary is installed at /usr/bin/php - this is the one that is installed by default.

Installing MAMP or XAMPP does not affect this. Instead you need to locate the path to MAMP or XAMPP's PHP binary and add it to your shell's $PATH.

If you installed XAMPP to its default location (/Applications/XAMPP) then you can add export PATH="/Applications/XAMPP/xamppfiles/bin:$PATH" to the end of your ~/.bash_profile and restart your terminal window.

i have the same problem, and i solved renaming the php executable in /usr/bin/php to /usr/bin/php.orig ( for example ) and create a symbolic link in that directory than point to php file in the mamp directory.

You may have multiple versions of PHP installed in your environment. Make sure you are using the correct one.

do at the command prompt:

which php

this will display the path to the PHP version being used. If it should be a different one then add the path to the correct version of php to your $PATH of your environment.

You may find this useful also:

http://mac.tutsplus.com/tutorials/server/upgrading-the-native-php-installation-on-os-x-mountain-lion/

Further to Rachael's comment (I don't have the rep to comment directly).

I had this issue after upgrading MAMP on my Mac. Everything looked fine but my php.ini was still referencing the old extension_dir.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top