centos7 安装php fileinfo扩展

centos7 安装php fileinfo扩展

composer install时报如下错误:

 - Installation request for intervention/image 2.4.0 -> satisfiable by intervention/image[2.4.0].
 - intervention/image 2.4.0 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.

1.解压你的php tar包,如果没有请下载同版本的tar包

$ tar -zxvf php-7.1.0.tar.gz

2.进入到fileinfo目录

$ cd php-7.1.0/ext/fileinfo

3.调用phpize生成编译配置文件

$ /usr/local/php/bin/phpize

4.编译扩展库

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

5.安装

$ make && make install

6.在配置文件下加入扩展

/usr/local/php/etc/php.ini 添加扩展:
extension=fileinfo.so

7.重启php

$ service php-fpm restart