Mcrypt with Mamp Pro on Mac OS X Yosemite 10.10
After yesterday's Yosemite update, something got confused with the Mcrypt extension. PHP based artistan client interface in Laravel framework returns:
Requires Mcrypt PHP extension.
The PATH variable seems to be correct. Where is the mistake? Everything worked fine before the upgrade.
++++ Configs ++++
Output of 'which php':
/Applications/MAMP/bin/php/php5.6.1/bin/php
'php -v':
PHP 5.6.1 (cli) (built: Oct 13, 2014 18:41:35) Copyright (c) 1997-2014 PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
.Bash_profile content:
export EDITOR = export nano PATH = / usr / bin: / bin: / usr / sbin: / sbin: / usr / local / bin: / opt / X11 / bin: / usr / texbin: / usr / local / mysql / bin export PATH = / Applications / MAMP / bin / php / php5.6.1 / bin: $ PATH
phpinfo ():
MAMP PRO version:
3.0.7.1
UPDATE:
Mamp-log says for every extension included in php.ini:
PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php5.6.1/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so' - dlopen (/ Applications / MAMP / bin / php / php5.6.1 / lib / php / extensions / no-debug-non-zts-20121212 / mcrypt.so, 9): Image not found in Unknown on line 0
source to share
I contacted MAMP support and this is what they answered.
Hello,
Our php.ini file is broken for 5.6.1. Go to your templates files and change this line
/Applications/MAMP/bin/php/php5.6.1 ....
to
/Applications/MAMP/bin/php/php5.6.1/lib/php/extensions/no-debug-non-zts-20131226
We'll have a full fix in a few days. You can also just upgrade to php 5.5. Meanwhile.
source to share
The fix was applied this morning by MAMP and MAMP PRO 3.0.7.2 Published: 2014-10-21. By default php 5.6.2
Don't forget to update .bash_profile
export PATH = / Applications / MAMP / bin / php / php5.6.2 / bin: $ PATH
Everything works fine on my local machine and also works fine with drush (for those who use it)
source to share
same error with you, but I dragged it fine now:
- Stop your MAMP
- Open / Applications / MAMP / bin / php / php 5.6.1 / conf / php.ini
- Find all "no-debug-non-zts-20121212" replace with "no-debug-non-zts-20131226"
- Open / Applications / MAMP / bin / php / php 5.6.1 / conf / pear.conf
- Find "no-debug-non-zts-20100525" replace with "no-debug-non-zts-20131226"
- Start your server
I recommend you unistall OS X default php and apache Path:
/etc/apache2
/usr/include/apahce2
/usr/libexec/apache2
/usr/php
/usr/bin/php
/usr/bin/php-config
/usr/bin/phpize
/usr/include/php
/usr/lib/php
/usr/share/man/man*/php*
/usr/bin/phar.phar
then
sudo ln -s /Applications/MAMP/bin/php/php5.6.1/bin/pear /usr/bin/pear
sudo ln -s /Applications/MAMP/bin/php/php5.6.1/bin/peardev /usr/bin/peardev
sudo ln -s /Applications/MAMP/bin/php/php5.6.1/bin/pecl /usr/bin/pecl
sudo ln -s /Applications/MAMP/bin/php/php5.6.1/bin/phar.phar /usr/bin/phar.phar
sudo ln -s /Applications/MAMP/bin/php/php5.6.1/bin/php /usr/bin/php
sudo ln -s /Applications/MAMP/bin/php/php5.6.1/bin/php-cgi /usr/bin/php-cgi
sudo ln -s /Applications/MAMP/bin/php/php5.6.1/bin/php-config /usr/bin/php-config
sudo ln -s /Applications/MAMP/bin/php/php5.6.1/bin/phpize /usr/bin/phpize
source to share
1) First check which php.ini file is loaded:
php -ini
You will probably see that none of the files have been downloaded.
2) If you don't mind reinstalling php, you can do this:
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6
3) Then set the path to your new php installation to avoid using the built-in php that comes with OSX.
To set the path, use this command - something like this, remember that your path may be different:
export PATH = / usr / local / php5 / bin: $ PATH
source to share