linux环境安装php fileinfo扩展

# PHP安装fileinfo扩展步骤:
## 第一步 查看fileinfo的源码路径
命令:find / -name fileinfo

结果:/www/server/php/56/src/ext/fileinfo


## 第二步 找到路径之后进入到fileinfo目录中
命令:cd /www/server/php/56/src/ext/fileinfo

## 第三步 执行phpize命令
命令:phpize

## 第四步 执行configure配置
命令:./configure --with-php-config=/www/server/php/56/bin/php-config

*(如果提示php-config命令不存在 configure: error: Cannot find php-config. Please use --with-php-config=PATH)*
可以执行yum install php-devel, 安装php-devel,安装完成之后再执行这条命令即可

## 第五步 编译安装
命令: make && make install

## 第六步 修改PHP配置文件
修改php.ini文件,添加extension=fileinfo.so

## 第七步 重启nginx和php
nginx重启命令:systemctl restart nginx

php重启命令:systemctl restart php-fpm
*(注意:重启前后进程号核对一下是否重启成功)*

原文地址:https://www.cnblogs.com/aten/p/11589318.html