下载libmcrypt 和 mcrypt
http://sourceforge.net/projects/mcrypt/files/(1)libmcrypt wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download
(2)mcrypt
wget http://sourceforge.net/projects/mcrypt/files/latest/download?source=files安装
顺序:libmcrypt => mhash => mcrypt
基本步骤(以mcrypt为例):
(1)mv download\@source\=files mcrypt.tar.gz
(2)tar zxvf mcrypt.tar.gz
(3)cd mcrypt
(4)./configure
(5)make
(6)make install安装php扩展
(1)使用php -v查看版本
(2)从 http://cn.php.net/releases/ 下载对应版本,在ext目录中找到mcrypt安装phpize(-bash: phpize: command not found)
(1)yum install php-devel
(2)phpize #执行命令初始化安装mcrypt扩展
(1)whereis php-config
(2)cd path_to_php_ext_mcrypt
(3)./configure --with-php-config=/usr/bin/php-config
(4)make && make install
(5)vi /etc/php.ini
添加一条extension=mcrypt.so查看是否安装成功(线上服务要重启Apache)
(1)php -m|grep mcrypt
参考链接:http://www.cnblogs.com/huangzhen/archive/2012/09/12/2681861.html
未经同意禁止转载!
转载请附带本文原文地址:Linux下安装PHP mcrypt扩展,首发自 Zjmainstay学习笔记