0

I have installed mcrypt and php56-mcrypt on my Mac OS X El Capitan and also I installed Apache, MySQL and PHP separately including phpMyAdmin. All of these are working fine, but when I try to run a laravel application, I get the message that says Mcrypt PHP extension required..

I am using a virtual host and when I run this domain configured on the virtual host, it shows the mcrypt error above. This shows the VH is working fine the problem comes from Laravel and Mcrypt.

But when I run php -m, I see that the mcrypt is enabled, below is the output.

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
json
ldap
libxml
mbstring
mcrypt
mhash
mysql

I have correctly included the mcrypt extension in the /etc/php.ini file and set enable_dl = On (as many solutions say). I don't know what I am missing.

I am also using PHP version 5.6 and below is the output

PHP 5.6.26 (cli) (built: Oct  1 2016 23:48:03) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

Mcrypt version:

Mcrypt v.0.9.9 (i386-apple-darwin15.0.0)
Linked against libmcrypt v.2.5.8
Copyright (C) 1998-2002 Nikos Mavroyanopoulos (nmav@gnutls.org)

I have done an extensive Google search and tried all possible answers but nothing error message for requiring mcrypt is not going anywhere.

Please if there is more information that is needed in this question, just leave a comment and I will provide, I have done so much research on fixing this issue but to know avail, nothing is working. Thanks in advance.

Derick Alangi
  • 1,080
  • 1
  • 11
  • 31
  • 2
    First: in most cases there are 2 different php.ini settings for cli and apache modes respectively. Make sure you have the mcrypt extension available on both. Second: make sure you have restarted apache after enabling the extension. – jakub wrona Oct 03 '16 at 16:43
  • I know not the answer you're looking for but this is why vagrant/homestead is a life saver, if you don't figure it out I would look into those. – Westwick Oct 03 '16 at 16:44
  • 1
    Trying going through the steps in the accepted answer in this question: http://stackoverflow.com/questions/33413798/mcrypt-problems-after-update-os-x-to-el-capitan?rq=1 – Westwick Oct 03 '16 at 16:51
  • It is best not to use mcrypt, it is abandonware, has not been updated in years and does not support standard PKCS#7 (née PKCS#5) padding, only non-standard null padding that can't even be used with binary data. mcrypt had many outstanding [bugs](https://sourceforge.net/p/mcrypt/bugs/) dating back to 2003. Instead consider using [defuse](https://github.com/defuse/php-encryption) or [RNCryptor](https://github.com/RNCryptor), they provide a complete solution and are being maintained and is correct. – zaph Oct 03 '16 at 16:53
  • Thanks @zaph, the problem here is that Laravel 4.2 requires Mcrypt. – Derick Alangi Oct 03 '16 at 16:57
  • @Drew, that was the first question or the second that I followed. I still did it again for benefit of doubt but I don't have a solution. – Derick Alangi Oct 03 '16 at 16:58

0 Answers0