多语言展示
当前在线:541今日阅读:19今日分享:20

Centos6.4 LAMP 解决mcrypt无法安装的问题

本文用centos6.4 在虚拟机下解决php扩展Mcrypt的问题先去我的百度云下载几个安装包:http://pan.baidu.com/share/link?uk=3&shareid=1620901082链接里包含有:php-5.3.3.tar.gz libmcrypt-2.5.8.tar.gz mhash-0.9.9.9.tar.gz mcrypt-2.6.8.tar.gz可以在window下载用winscp传过去放在ROOT目录下,或者可以直接在centos下用wget下载(默认下载目录在ROOT下)。可以在centos图形界面下看到开启Terminal1.在Terminal输入[root@localhost libmcrypt-2.5.8]# yum -y install gcc gcc-c++(可以解决checking for C++ compiler default output file name… configure: error: C++ compiler cannot create executables的错误)2.在Terminal输入[root@localhost libmcrypt-2.5.8]# yum install make(可以解决-bash: make: command not found 错误,没有安装make才会出现这个错误)3.在Terminal输入[root@localhost mcrypt]# whereis phpize如果如下图出现的情况,则表明已经安装phpize4.如果没有则需要安装,在Terminal输入[root@localhost mcrypt]# yum -y install php-devel5.开始安装Libmcrypt库[root@localhost ~]# tar -zxvf libmcrypt-2.5.8.tar.gz(解压libmcrypt)[root@localhost ~]#cd libmcrypt-2.5.8[root@localhost libmcrypt-2.5.8]# ./configure[root@localhost libmcrypt-2.5.8]# make && make install[root@localhost libmcrypt-2.5.8]cd6.开始安装mhash库[root@localhost ~]# tar -zxvf mhash-0.9.9.9.tar.gz[root@localhost ~]#cd mhash-0.9.9.9[root@localhost mhash-0.9.9.9]# ./configure[root@localhost mhash-0.9.9.9]# make && make install[root@localhost mhash-0.9.9.9]#cd7.解压php[root@localhost ~]# tar -zxvf php-5.3.3.tar.gz[root@localhost ~]# cd php-5.3.3/ext/mcrypt8.通过PHPIZE安装并编译Mcrypt[root@localhost mcrypt]# /usr/bin/phpize[root@localhost mcrypt]# ./configure -with-php-config=/usr/bin/php-config[root@localhost mcrypt]# make && make install[root@localhost mcrypt]#cd9.在php.ini中添加extension=mcrypt.so[root@localhost ~]# vi /etc/php.ini按“↓”键至最后,按 “i” 键可以进行编辑,extension=mcrypt.so编辑完毕,按 “ESC” 键退出编辑模式,然后按”Shift+:”键,输入:wq10.重启apache[root@localhost ~]#service httpd restart解决问题
推荐信息