Linux安装PHP扩展

615 阅读1分钟

例:php 7.2 安装 mcrypt 扩展

1、yum 安装依赖包:

$ yum install libmcrypt libmcrypt-devel mcrypt mhash

2、在 php 官网下载 mcrypt 包,php 扩展官网

$ wget  http://pecl.php.net/get/mcrypt-1.0.1.tgz
$ tar xf mcrypt-1.0.1.tgz
$ cd mcrypt-1.0.1

3、编译安装 mcrypt

执行phpize生成configure

$ /usr/local/php/bin/phpize

指定安装 PHP 的时的配置

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

编译和安装

$ make 
$ make install