为什么要关闭 fileinfo? fileinfo 有什么隐患吗?

2015-05-24 10:10:06 +08:00
 iugo
在某脚本编译 PHP 的时候, 存在这样一句

--disable-fileinfo

可是我正在使用的小工具需要这个东西.

想问一下为什么这个脚本在编译的时候加上这样一个参数, fileinfo 是不被推荐的吗?

http://php.net/manual/zh/fileinfo.installation.php 中描述, fileinfo 在 5.3 以后就被默认安装的, 应该是 PHP 官方建议的东西.
7978 次点击
所在节点    PHP
5 条回复
xbonline
2015-05-24 10:27:55 +08:00
很久以前,在我的小内存VPS上编译PHP会out of memory,加上disable-fileinfo后就可以顺利编译了
zts1993
2015-05-24 10:59:54 +08:00
@xbonline 正解
dryyun
2015-05-24 12:03:24 +08:00
记得1G以下的内存,编译会出现问题,就需要--disable-fileinfo
liuhaotian
2015-05-24 12:40:07 +08:00
The functions in this module try to guess the content type and encoding of a file by looking for certain magic byte sequences at specific positions within the file. While this is not a bullet proof approach the heuristics used do a very good job.

我的小内存 vps 昨天编译 out of memory,然后进程被 kill,disable 这个之后就可以了。
FrankFang128
2015-05-24 17:30:52 +08:00
感觉就不应该被开启的样子。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/193309

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX