1、进入对应php版本扩展目录:

cd /opt/php-7.2.12/ext/fileinfo

2、编译及安装

/usr/local/php/bin/phpize
./configure -with-php-config=/usr/local/php/bin/php-config
make
make install

3、修改php.ini

extension = fileinfo.so

4、重启php-fpm生效

systemctl restart php-fpm