怎样安装PHP的fileinfo扩展

2018年12月18日 | 分类: 【技术】

【安装】

下载 php 源程序:

wget http://php.net/distributions/php-7.3.13.tar.xz && tar -xvf php-7.3.13.tar.xz && cd php-7.3.13

进入php源程序目录中的ext目录中,这里存放着各个扩展模块的源代码,选择fileinfo模块。

cd ext/fileinfo/ && /usr/local/php/bin/phpize && ./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

输出:

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20180731/
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-zts-20180731/

【设置】

在 php.ini 文件中添加:

; [fileinfo]
extension = "fileinfo.so"

然后重启Apache即可加载。

【参考】

参考:https://blog.csdn.net/m_nanle_xiaobudiu/article/details/80838424
参考:https://blog.csdn.net/qivan/article/details/64439911