安装 fileinfo php 扩展

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10189266/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 21:36:21  来源:igfitidea点击:

Install fileinfo php extension

phpapacheputtywhm

提问by Lalit Arora

As the fileinfo is moved from PECL to PHP. What is the best way to install it through WHM or putty.?

当文件信息从 PECL 移动到 PHP 时。通过WHM或腻子安装它的最佳方法是什么?

I tried following command:

我尝试了以下命令:

pecl install fileinfo

and received following error:

并收到以下错误:

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/local/bin/phpize' in the top level source directory of the module

ERROR: `phpize' failed

警告:“pear/Fileinfo”已被弃用,取而代之的是“channel://php-src/ext/fileinfo/in php 源代码”

“警告:频道“pear.php.net”已更新其协议,请使用“pecl channel-update pear.php.net”进行更新

下载 Fileinfo-1.0.4.tgz ...

开始下载 Fileinfo-1.0.4.tgz(5,835 字节)

.....完成:5,835 字节

3个源文件,构建

运行: phpize

找不到 config.m4。

确保在模块的顶级源目录中运行“/usr/local/bin/phpize”

错误:`phpize' 失败

回答by Saket Patel

This extension is enabled by default as of PHP 5.3.0. Before this time, fileinfo was a PECL extension but is no longer maintained there. However, versions prior to 5.3+ may use the ? discontinued PECL extension.

自 PHP 5.3.0 起默认启用此扩展。在此之前,fileinfo 是 PECL 扩展名,但不再在那里维护。但是,5.3+ 之前的版本可能会使用 ? 停止 PECL 扩展

Reference:

参考:

http://www.php.net/manual/en/fileinfo.installation.php

http://www.php.net/manual/en/fileinfo.installation.php



ERROR: `phpize' failed

This error is displayed because you don't have php-develpackage installed

显示此错误是因为您没有安装php-devel软件包

回答by vchakoshy

Are you install php-devel?
phpize execute need's php-devel package. if you are on centos run the following code

你安装 php-devel 了吗?
phpize 执行需要的 php-devel 包。如果你在 centos 上运行以下代码

yum install php-devel