centos源码编译php5mcrypt模块步骤详解
步骤:
1.从php.net上面下载php5.3.x版本的源码;
2.centos安装相应的扩展包:
yuminstalllibmcryptlibmcrypt-develmcryptmhash
下面的开发环境是为了编译整个php源码准备的环境,此次编译mcrypt扩展不需要执行.
yuminstall-yhttpd-devellibtool-ltdllibtool-ltdl-developenssl-develcurl-devel \
libjpeglibjpeg-devellibpnglibpng-develfreetypefreetype-devel\
libc-clientlibc-client-devel gdgd-devellibmcryptlibmcrypt-devel\
sqlitesqlite-develmysql-devellibiculibicu-develpcre-devel
3.确定phpize有安装到服务器:
whereisphpize
确定php-config的位置:
whereisphp-config
执行:
./configure?with-php-config=/usr/bin/php-config
4.make错误:
mcrypt.c:283:error:‘PHP_FE_END"undeclaredhere(notinafunction)
解决方法:
如果是ZEND_MOD_END的错误,则执行: 5.执行下maketest,测试没有问题.再执行:
sed-i"s|PHP_FE_END|{NULL,NULL,NULL}|"./ext/**/*.c
make
sed-i"s|ZEND_MOD_END|{NULL,NULL,NULL}|"./ext/**/*.c
makeinstall
6.增加文件:/etc/php.d/mcrypt.ini
;Enablembstringextensionmodule
extension=mcrypt.so
7.重启web服务器,检查phpmcrypt是否安装成功.
相关文章