problem with mcrypt installation

后端 未结 6 1120
不思量自难忘°
不思量自难忘° 2021-02-19 09:08

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

6条回答
  •  半阙折子戏
    2021-02-19 09:36

    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.

提交回复
热议问题