到PHP解压缩目录 /ext/fileinfo
执行 php安装文件夹bin下的 phpize
然后执行
./configure --with-php-config=/usr/local/php/bin/php-config --enable-fileinfo
最后编译安装
make && make install
编译安装完成在php.ini 文件 添加一句
(我的是添加了拓展路径 extension_dir="/www/source/php/lib/php/extensions/no-debug-zts-20180731/" )
extension=fileinfo.so