Linux Environment installation PHP fileinfo extension
Windows Environment installation extension is relatively simple, just copy the DLL to the extended directory, modify the corresponding extension in the php.ini.
The following is an introduction to the Linux environment in the PHP extension installation, to centos6.5 and php7.1 as an example, to introduce the installation of FileInfo.
According to the manual, FileInfo extensions are turned on by default after php5.3, so we do not need to install them separately. However, some integrated environment to improve the speed of compiling PHP or save resources to remove this extension of the installation. So we need to install it on our own.
We install this extension from the FileInfo source code. FileInfo source code in the PHP source code "Src/ext/fileinfo" under the directory, you can find a specific path
Find/-name FileInfo
After the path is found, enter into the FileInfo directory.
To start an extended installation:
1. Phpize
Execute phpize command
2./configure--with-php-config=/usr/local/php/bin/php-config
Perform configure configuration.
If prompted Php-config command does not exist Configure:error:Cannot find Php-config. Please use--with-php-config=path
You can perform yum install php-devel, install Php-devel, and then execute this command after the installation is complete.
3. Make && make install
Compiling the installation
4. Modify php.ini file, add extension=fileinfo.so
The installation has been successful so far.