iugo
V2EX  ›  PHP

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

  •  
  •   iugo · May 24, 2015 · 8560 views
    This topic created in 4034 days ago, the information mentioned may be changed or developed.
    在某脚本编译 PHP 的时候, 存在这样一句

    --disable-fileinfo

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

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

    http://php.net/manual/zh/fileinfo.installation.php 中描述, fileinfo 在 5.3 以后就被默认安装的, 应该是 PHP 官方建议的东西.
    5 replies    2015-05-24 17:30:52 +08:00
    xbonline
        1
    xbonline  
       May 24, 2015 via Android   ❤️ 1
    很久以前,在我的小内存VPS上编译PHP会out of memory,加上disable-fileinfo后就可以顺利编译了
    zts1993
        2
    zts1993  
       May 24, 2015
    @xbonline 正解
    dryyun
        3
    dryyun  
       May 24, 2015
    记得1G以下的内存,编译会出现问题,就需要--disable-fileinfo
    liuhaotian
        4
    liuhaotian  
       May 24, 2015
    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
        5
    FrankFang128  
       May 24, 2015
    感觉就不应该被开启的样子。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   932 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 19:46 · PVG 03:46 · LAX 12:46 · JFK 15:46
    ♥ Do have faith in what you're doing.