Install fileinfo extensions to PHP7.0 on CentOs


Because the construction of the project is in a preliminary stage, it is inevitable that a series of problems occurred due to the immaturity of the environment. In the procedure of file operation, an error of lack of expansion was reported, which has been solved

Have a look at the instructions given official,…

Solving steps

First: first find the location of PHP installation source code, I downloaded to /usr/local/src directory

Install fileinfo extensions to PHP7.0 on CentOs
Once you’ve determined where the PHP source package is installed, go to the fileinfo directory under ext

cd /usr/local/src/php-7.0.23/ext/fileinfo/

The second: find phpize directory (about phpize is what east east, the official… )

Usually in the bin directory under the PHP directory, my environment is in /usr/local/php/bin directory


Without leaving the ext/fileinfo directory of the PHP installation source, execute the following command



Configuring for:
PHP Api Version:         20151012
Zend Module Api No:      20151012
Zend Extension Api No:   320151012

Third: execute orders

./configure --with-php-config=/usr/local/php/bin/php-config
make && make install

Return the following command line to indicate that the installation was successful

Build complete.
Don't forget to run 'make test'.
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/

Fourth: find the phpini location and open the extension for phpini

Install fileinfo extensions to PHP7.0 on CentOs

Finally, restart apache, refresh phpinfo, and see the big eight letters fileinfo, O(∩_∩)O