-1

Call to undefined function mcrypt_get_block_size()

php version - 5.6.6
os- yosemite 10.10.2
mcrypt version- 2.5.8

Need help

Saghir A. Khatri
  • 3,429
  • 6
  • 45
  • 76

3 Answers3

1

You may actually have to add a symlink in /etc/php5/apache/conf.d to the mcrypt.ini file. After that, restart the webserver and inspect phpinfo().

  • Might be helpful to add detail about "symlink". – D_Bester Dec 16 '15 at 08:47
  • My configuration may have changed in two years. On my machine, apache has the mcrypt installed as module. I enabled this module using `sudo a2enmod mcrypt` then in the folder mentioned there will be a link to mods-available/mcrypt.ini Please note I'm using a linux flavor, not OSX. – Bas Cost Budde Apr 03 '17 at 06:24
0

You have to enable the mcrypt extension.

Add the following line to the php.ini:

extension=mcrypt.so

Then restart your webserver.

sg-
  • 2,196
  • 1
  • 15
  • 16
0

For people who are on OSX

php -v

will give you the php version, and if you have brew do:

brew search mcrypt

you will see things like

homebrew/php/php53-mcrypt  homebrew/php/php55-mcrypt  homebrew/php/php70-mcrypt
homebrew/php/php54-mcrypt  homebrew/php/php56-mcrypt

install the one appropriate to your php version

then look at the /usr/local/etc/php/x.x/conf.d/ext-mcrypt.ini and add the contents to your php.ini.

restart your webserver and see the phpinfo(). you should see mcrypt loaded as a module.

Kinjal Dixit
  • 7,777
  • 2
  • 59
  • 68