Compile and install the fileinfo extension under Centos 0.why complie fileinfo extension Today, a colleague wanted to do a function and found that when PHP was originally installed When the fileinfo extension is not compiled but pecl install is used, the .m4 file cannot be found and other trivial installation failure problems occur. So I still use phpize to install the extension."/> Compile and install the fileinfo extension under Centos 0.why complie fileinfo extension Today, a colleague wanted to do a function and found that when PHP was originally installed When the fileinfo extension is not compiled but pecl install is used, the .m4 file cannot be found and other trivial installation failure problems occur. So I still use phpize to install the extension.">

Home >Backend Development >PHP Tutorial >Compile and install fileinfo extension with PHP under Centos

Compile and install fileinfo extension with PHP under Centos

WBOY
WBOYOriginal
2016-07-29 08:51:051707browse

data-id="1190000005058875" data-license="cc">

Compile and install fileinfo extension under Centos

0.why complie fileinfo extension

Today a colleague wanted to do a function and found that the fileinfo extension was not compiled when PHP was originally installed.

But when using pecl install, there are other trivial installation failure problems such as the .m4 file not being found.
So it’s better to use phpize to install the extension.

1. Check the current environment

php -i|grep fileinfo
If
fileinfo
fileinfo support => enabled
appears, it means the fileinfo extension is available, otherwise it is not available.

2. Installation

2-1: Download

wget -O php-5.6.9.tar.gz http://cn2.php.net/get/php-5.6.9.tar.gz/from /this/mirror

2-2: Unzip

tar -zxvf php-5.6.9.tar.gz

2-3: Enter the corresponding php version extension directory (I am version 5.6.9)

cd /var/php5.6.9/php-5.6.9/ext/fileinfo

2-4: Compile && Install

<code>/usr/local/php/bin/phpize
./configure -with-php-c/local/php/bin/php-config
make && make install
vim /usr/local/php/etc/php.ini
</code>

2-5: Modify php.ini

Add:extension=fileinfo.so

Need this article to be helpful to you

The above introduces the fileinfo extension for PHP compilation and installation under Centos, including the content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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
Previous article:php控制客户端缓存Next article:php之文件上传和下载