为什么在 CentOS 上的 PHP 中 /usr/share/file/magic 没有加载?

为什么在 CentOS 上的 PHP 中 /usr/share/file/magic 没有加载?

这就是我正在做的事情:

$ php
<?php
$finfo=finfo_open(FILEINFO_MIME, '/usr/share/file/magic');

这就是我得到的:

PHP Notice:  finfo_open(): Warning: description `8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice data enco' truncated in - on line 2
PHP Notice:  finfo_open(): Warning: description `8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice data enco' truncated in - on line 2
PHP Notice:  finfo_open(): Warning: <= not supported in - on line 2
PHP Notice:  finfo_open(): Warning: <= not supported in - on line 2
PHP Notice:  finfo_open(): Warning: <= not supported in - on line 2
PHP Notice:  finfo_open(): Warning: >= not supported in - on line 2
PHP Warning:  finfo_open(): Failed to load magic database at '/usr/share/file/magic'. in - on line 2

这是干净的 CentOS 5.5 安装,PHP 5.3。该文件/usr/share/file/magic存在并且可以访问。

相关内容