3
votes

I have a problem with mcrypt(and Laravel) after update Yosemite to El Capitan. When i run local site(Laravel Framework version 4.2.17), i'm getting

Mcrypt PHP extension required.

Here are my settings:

1) which php

/usr/local/bin/php

2) php --version

PHP 5.6.14 (cli) (built: Oct  3 2015 14:54:13) 
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
with Xdebug v2.3.3, Copyright (c) 2002-2015, by Derick Rethans

3) php --ini

Configuration File (php.ini) Path: /usr/local/etc/php/5.6
Loaded Configuration File:         /usr/local/etc/php/5.6/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.6/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.6/conf.d/ext-mcrypt.ini,
/usr/local/etc/php/5.6/conf.d/ext-xdebug.ini,
/usr/local/etc/php/5.6/conf.d/redis.ini

4) cat /usr/local/etc/php/5.6/conf.d/ext-mcrypt.ini | grep --color -i mcrypt

[mcrypt]
extension="/usr/local/opt/php56-mcrypt/mcrypt.so"

5) ll /usr/local/opt/php56-mcrypt/

total 112
drwxr-xr-x  5 olga  admin    170 Oct 29 07:31 .
drwxr-xr-x  5 olga  admin    170 Oct 29 07:31 ..
-rw-r--r--  1 olga  admin    373 Oct 29 07:31 INSTALL_RECEIPT.json
-rw-r--r--  1 olga  admin    107 Sep 30 01:35 TODO
-rwxr-xr-x  1 olga  admin  45284 Oct 29 07:31 mcrypt.so

6) php -i | grep --color -i mcrypt

Additional .ini files parsed => /usr/local/etc/php/5.6/conf.d/ext-mcrypt.ini,
Registered Stream Filters => zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*
PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value

7) php -m | grep --color -i mcrypt

mcrypt

8) echo $PATH

/Volumes/project1/code/scripts/:/usr/local/mysql:/Applications/Adobe Flash Builder 4.6/sdks/4.5.0/bin:/Volumes/project1/code/tools/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/olga/.rvm/bin:~/Applications/arcanist/bin/:/usr/local/Cellar/php56/5.6.14/bin:~/.composer/vendor/phpunit/phpunit:/usr/local/bin:/usr/local/mysql/bin:/Users/olga/.composer/vendor/bin:/opt/apache-maven-3.3.3/bin

9) (php from the $PATH) /usr/local/Cellar/php56/5.6.14/bin/php --ini

Configuration File (php.ini) Path: /usr/local/etc/php/5.6
Loaded Configuration File:         /usr/local/etc/php/5.6/php.ini
Scan for additional .ini files in: /usr/local/etc/php/5.6/conf.d
Additional .ini files parsed:      /usr/local/etc/php/5.6/conf.d/ext-mcrypt.ini,
/usr/local/etc/php/5.6/conf.d/ext-xdebug.ini,
/usr/local/etc/php/5.6/conf.d/redis.ini

What am i missing?

Thank you in advance

1
stackoverflow.com/questions/16830405/… Have you seen this questionMihai
@Mihai yes, i did. i've changed PATH to export PATH="/usr/local/opt/php56/bin":$PATH but it didn't helpOlga Zhe

1 Answers

2
votes

Finally i fixed it! Still don't know the reason, but... Here is how i've solved it

1) put homebrew php to the PATH

export PATH="/usr/local/opt/php56/bin":other_paths

2) change php module in apache(httpd.conf)

LoadModule php5_module /usr/local/opt/php56/libexec/apache2/libphp5.so
#LoadModule php5_module libexec/apache2/libphp5.so`

3) uninstall all versions mcrypt and phpXX_mcrypt

4) delete phpXX_mcrypt ini-file

5) restart apache. Make sure that mcrypt is not in php(for ex. php -i | grep --color -i mcrypt)

6) install mcrypt and phpXX_mcrypt with brew

brew search mcrypt
brew install mcrypt
brew install phpXX_mcrypt

7) restart apache

Hope it will help :)