mcrypt以及mhash扩展的安装!

http://www.sourceforge.net该站下载
2.先安装Libmcrypt
     #tar -zxvf libmcrypt-2.5.8.tar.gz
     #cd libmcrypt-2.5.8
     #./configure
     #make
     #make install
   说明:libmcript默认安装在/usr/local
3.安装mhash
    #tar -zxvf mhash-0.9.9.9.tar.gz
     #cd mhash-0.9.9.9
     #./configure
     #make
     #make install
4.安装mcrypt
     #tar -zxvf mcrypt-2.6.8.tar.gz
      #cd mcrypt-2.6.8
      #LD_LIBRARY_PATH=/usr/local/lib ./configure
      #make
      #make install
    说明:由于在配置Mcrypt时,会找不到libmcrypt的链接库,导致无法编译,因为Libmcrypt的链接库在/usr/local/文件夹下。
        因此在配置mcrypt时要加入LD_LIBRARY_PATH=/usr/local导入键接库
5.安装PHP
      在配置PHP是加入:
      #./configure --with-mcrypt --with-mhash
      或者通过php的phpize动态添加的方式,到源码的ext/的相应目录,执行
      /usr/bin/phpize
      ./configure --with-php-config=/usr/bin/php-config
      make
      make install
      然后把生成的.so文件在php.ini文件里引用后重启apache就可以了!
原文地址:https://www.cnblogs.com/feihongwuhen/p/7170420.html