centos6.5编译mcrypt

下载php源代码进行编译

cd php/ext/mcrypt
phpize
error: 
    No package libmcrypt available.
    No package libmcrypt-devel available.
    No package mcrypt available.
    No package mhash available.

yum  install epel-release  //扩展包更新包
yum  update //更新yum源
yum install libmcrypt libmcrypt-devel mcrypt mhash  就ok了

./configure
error
    /Downloads/php-5.5.31/ext/mcrypt/mcrypt.c:283: 错误:‘PHP_FE_END’未声明(不在函数内)

解决方案

sed -i 's|PHP_FE_END|{NULL,NULL,NULL}|' ./*.c

sed -i 's|ZEND_MOD_END|{NULL,NULL,NULL}|' ./*.c 

下一步:

./configure
make
make test // 可以省略
sudo make install

下一步:
make install 后, 我们就在 /usr/lib64/php/modules/ 里面看到 mcrypt.so

 cd /etc/php.d/
 sudo vi mcrypt.ini
   extension=mcrypt.so

重启apache 看效果啦

你可能感兴趣的:(php,linux)