进入安装扩展的源码目录

cd /usr/local/src/php-5.3.8/ext/mcrypt

 运行phpize

/usr/local/php/bin/phpize

编译安装

./configure --with-php-config=/usr/local/php5/bin/php-config

提示缺少mcrypt.h文件

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

安装libmcrypt

wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
tar zxf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure
make
make install

搞定

 
重新运行
./configure --with-php-config=/usr/local/php5/bin/php-config

成功

make
make install     // 这一步不一定要进行,make会生成相应的.so文件,在目录的module中,拷贝相应的so到/usr/local/php/lib/php/extensions/目录下亦可

编辑php.ini,加入

extension = "mcrypt.so"

 

安装成功

相关文章:

  • 2021-08-17
  • 2022-12-23
  • 2021-07-20
猜你喜欢
  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2021-05-21
  • 2021-11-16
  • 2021-12-23
相关资源
相似解决方案