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

Compile and install fileinfo extension with PHP under Centos

WBOY
Release: 2016-07-29 08:51:05
Original
1690 people have browsed it

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>
Copy after login

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.

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