Home > Backend Development > PHP Tutorial > linux安装fileinfo扩展出现错误怎么办

linux安装fileinfo扩展出现错误怎么办

PHPz
Release: 2020-09-04 17:08:36
Original
2499 people have browsed it

linux安装fileinfo扩展出现错误的解决办法:首先使用命令【which phpize】查看phpize的路径;然后选择需要的Fileinfo扩展;最后按照提示添加【Fileinfo】扩展的绝对路径到php.ini配置文件中即可。

linux安装fileinfo扩展出现错误怎么办

linux安装fileinfo扩展出现错误怎么办?

在linux下安装fileinfo扩展时,出现如下错误提示,是什么个意思(百度过了,找不到答案)

[root@AY130324201613791bca Fileinfo-1.0.4]# 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
WARNING: php_bin /alidata/server/php/bin/php appears to have a suffix /bin/php, but config variable php_suffix does not match
running: phpize
Cannot find config.m4.
Make sure that you run '/alidata/server/php/bin/phpize' in the top level source directory of the module
ERROR: `phpize' failed
Copy after login

主要是这句

Make sure that you run '/alidata/server/php/bin/phpize' in the top level source directory of the module
Copy after login

不知为何你pecl程序没有找到phpize路径

那么试试手动安装:

1.先看下phpize路径在哪里which phpize(这里假设在\use\bin\phpize)

2.去挑你需要Fileinfo扩展的版本(这个是最新版本 wget http://pecl.php.net/get/Fileinfo-1.0.4.tgz)

3.tar -xvf Fileinfo-1.0.4.tgz && cd Fileinfo-1.0.4 && \use\bin\phpize

4.最后按照提示添加Fileinfo扩展绝对路径到php.ini中

5.php -m 看下有没加载扩展了。

推荐:《linux教程

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template