Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/283.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Ubuntu中安装php扩展文件信息(15.10)_Php_Ubuntu - Fatal编程技术网

在Ubuntu中安装php扩展文件信息(15.10)

在Ubuntu中安装php扩展文件信息(15.10),php,ubuntu,Php,Ubuntu,我曾尝试在Ubuntu(15.10)中安装php fileinfo扩展,但出现以下错误: sudo pecl install fileinfo 错误: WARNING: "pear/Fileinfo" is deprecated in favor of "channel://php-src/ext/fileinfo/in php sources" WARNING: channel "pear.php.net" has updated its protocols, use "pecl chann

我曾尝试在Ubuntu(15.10)中安装php fileinfo扩展,但出现以下错误:

sudo pecl install fileinfo
错误:

WARNING: "pear/Fileinfo" is deprecated in favor of "channel://php-src/ext/fileinfo/in php sources"
WARNING: channel "pear.php.net" has updated its protocols, use "pecl channel-update pear.php.net" to update
downloading Fileinfo-1.0.4.tgz ...
Starting to download Fileinfo-1.0.4.tgz (5,835 bytes)
.....done: 5,835 bytes
3 source files, building
running: phpize
Cannot find config.m4.
Make sure that you run '/usr/bin/phpize' in the top level source directory of the module

If the command failed with 'phpize: not found' then you need to install php5-dev packageYou can do it by running 'apt-get install php5-dev' as a root userERROR: `phpize' failed
然后我尝试了这个命令:

sudo apt-get install php5-dev
输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
php5-dev is already the newest version.
The following packages were automatically installed and are no longer required:
  linux-headers-4.2.0-16 linux-headers-4.2.0-16-generic
  linux-image-4.2.0-16-generic linux-image-extra-4.2.0-16-generic
  linux-signed-image-4.2.0-16-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
如何安装php文件信息扩展?
如何启用此扩展?

从PHP 5.3.0开始,默认情况下启用此扩展

在此之前,fileinfo是一个PECL扩展,但不再在那里维护

参考:

如何启用此扩展?在Ubuntu上,默认情况下会启用此扩展。检查phpinfo是否已启用。你可以在php.ini中设置你的扩展,在phpinfo中检查,它就在那里:)我如何在php.ini中启用fileinfo,我在php.ini中找到
fileinfo
,它似乎不在那里!Fileinfo没有在php.iniTry中定义的配置指令来使用示例代码并检查它是否正常工作,因为Fileinfo是从PHP5.3.0开始启用的。