How to install the fileinfo extension for php7
This article will explain in detail how to install the fileinfo extension in php7. The content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have some understanding of the relevant knowledge after reading this article.
Php7 install fileinfo extension method: 1, download and install php7;2, enter the PHP7 installation directory, open the configuration file "php.ini"; 3, in the configuration file, add "extension=fileinfo.so;" code, and save the file; 4, restart php.
The operating environment of this tutorial: CentOS 6 system, PHP7.1 version, Dell G3 computer.
First, make sure to install php7, and if not, install it:
Download the php7 source code
Wget https://www.php.net/distributions/php-7.3.9.tar.bz2
Decompression
Tar-xvf php-7.3.9.tar.bz2cd php-7.3.9/ext/fileinfo/
Compilation start
Phpize./configure-- with-php-config=/usr/local/php/bin/php-config / / Note-- the directory where the with-php-config= php-config file is located / / if you don't know-- the with-php-config directory can get whereis php-configsudo make & & sudo make install with the following command
Install the fileinfo extension
Modify the php.ini file
/ / regardless of whether the file exists or does not exist, sudo vi / usr/local/php/etc/php.ini / / write the sentence extension=fileinfo.so
Then restart php
Verify that the installation is successful
Enter the following command to test whether the installation is successful
Php-m | grep 'file' / / fileinfo indicates success after execution
On how to install php7 fileinfo extension to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.