1. First check to see if the system is installed
[root@izbp1dwql3ymcem09rfdchz ~]# php -i|grep fileinfo Configure Command => './configure ' '--prefix=/alidata/server/php ' '--enable-opcache ' '- -with-config-file-path=/alidata/server/php/etc ' '--with-mysql=mysqlnd ' '--with-mysqli=mysqlnd ' '--with-pdo-mysql=mysqlnd ' '--enable-fpm ' '--enable-fastcgi ' '--enable-static ' '-- Enable-inline-optimization ' '--enable-sockets ' '--enable-wddx ' '--enable-zip ' '-- Enable-calendar ' '--enable-bcmath ' '--enable-soap ' '--with-zlib ' '--with-iconv ' '-- With-gd ' '--with-xmlrpc ' '--enable-mbstring ' '--without-sqlite ' '--with-curl ' '-- Enable-ftp ' '--with-mcrypt ' '--with-freetype-dir=/usr/local/freetype.2.1.10 ' '--with-jpeg-dir=/ Usr/local/jpeg.6 ' '--with-png-dir=/usr/local/libpng.1.2.50 ' '--disable-ipv6 ' '--disable-debug ' '--with-openssl ' '--disAble-maintainer-zts ' '--disable-safe-mode ' '--disable-fileinfo ' fileinfo fileinfo support => enabled
If the above instructions have been installed
2. Download the PHP installation package command that contains FileInfo extensions, or download FileInfo to compile the package separately
Wget-o php-5.6.9.tar.gz Http://cn2.php.net/get/php-5.6.9.tar.gz/from/this/mirror
3. Decompression
TAR-ZXVF php-5.6.9.tar.gz
4. After the current directory is extracted, enter the following directory
CD php-5.6.9/ext/fileinfo/
5. Locate the command Phpize execute the build. Configure file in the bin directory of the previously compiled and installed PHP
I have installed the PHP directory command:/alidata/server/php-5.5.7/bin/phpize
6. Configure, compile and install
./configure-with-php-config=/alidata/server/php-5.5.7/bin/php-config
Make && make install
7. Modify PHP.ini
Add: extension=fileinfo.so
8. Reboot the server