【发布时间】:2016-08-25 13:34:47
【问题描述】:
它在 Centos 7 上,PHP 5.5.38
我以为fileinfo是默认开启的,但是phpinfo()显示如下:
'./configure' **'--disable-fileinfo'** '--disable-opcache' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-mbstring' '--enable-pdo=shared' '--enable-soap' '--enable-sockets' '--enable-zip' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/opt/xml2' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-mysqli=/usr/bin/mysql_config' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr'
那么我该如何启用这个文件信息呢?
当前的扩展文件夹没有fileinfo.so,所以我不知道我现在需要做什么来启用它。
【问题讨论】:
-
这取决于您如何安装 PHP。如果您通过包管理器安装它,那么您需要使用包管理器在加载的存储库中为 PHP 的 fileinfo 扩展找到合适的包。如果您自己编译 PHP,则需要启用扩展重新编译或单独编译扩展并作为共享扩展加载。
-
我记得它是作为 WHM/Cpanel 安装的一部分安装的。
-
好吧,那么它就变成了支持 WHM/Cpanel 的人的支持问题。无论如何,这个问题不是 StackOverflow 的主题,因为它不是一个编程问题。如果您足够关心那里询问,它可能更适合ServerFault。