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.