步骤:
1.从php.net上面下载php5.3.x版本的源码;
2.centos安装相应的扩展包:
下面的开发环境是为了编译整个php源码准备的环境,此次编译mcrypt扩展不需要执行.
libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel
libc-client libc-client-devel gd gd-devel libmcrypt libmcrypt-devel
sqlite sqlite-devel mysql-devel libicu libicu-devel pcre-devel
3.确定phpize有安装到服务器:
whereis phpize
确定php-config的位置:
whereis php-config
执行:
./configure Cwith-php-config=/usr/bin/php-config
4.make错误:
mcrypt.c:283: error: ‘PHP_FE_END’ undeclared here (not in a function)
解决方法:
make
如果是ZEND_MOD_END的错误,则执行:
5.执行下 make test,测试没有问题.再执行:
6.增加文件: /etc/php.d/mcrypt.ini
extension=mcrypt.so
7.重启web服务器,检查php mcrypt是否安装成功.












暂无评论内容