I\'ve asked the system admins to install mcrypt on the server, and they say everything is OK. But when I run my simple script I get this.
Warning
The mcrypt algorithms directory must be a directory containing the algorithms, not a binary. This means that this:
$modes = mcrypt_list_modes("/usr/local/bin/mcrypt");
Should be this instead (assuming mcrypt is installed is /usr/local/lib/libmcrypt
):
$modes = mcrypt_list_modes("/usr/local/lib/libmcrypt");
If the directory where libmcrypt
is installed is not that one above, you have to update your php.ini setting. Taken from php.ini:
[mcrypt]
; Directory where to load mcrypt algorithms
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.algorithms_dir=
; Directory where to load mcrypt modes
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.modes_dir=
If you have shell access, you can try this command to find the lib directory for your mcrypt installation:
whereis libmcrypt
or...
whereis mcrypt
Depending on your setup.