Last update at :2024-06-27,Edit by888u
A few days ago, Snail compiled a method to install the Fileinfo extension in the OneInstack environment in \\"Installing the Fileinfo PHP extension in the OneInStack Web environment\\". Because the system comes with a quick script, the installation is more convenient. However, I did not see any automatic shortcut commands when using LNMP (LNMP.ORG), another commonly used one-click WEB installation environment.
So, in this article, Snail will sort out how to install the Fileinfo extension in the LNMP WEB environment and record it for reference when needed.
First, preparations
If there is more important data in our environment, it is recommended that we back up the website data with snapshots or other methods. And when using the following method to install the fileinfo extension, you need to have a little scripting knowledge, because you need to enter the script for execution.
If we are not sure about the feasibility, we can install it in the test environment first. In the environment below, Snail is installed with LNMP1.4 version.
Second, decompress the corresponding PHP version
cd /root/lnmp1.4/src
Different PHP versions correspond to different compiled packages. Here we need php -v to check the current PHP version, then find the PHP installation package in the corresponding directory above, and then unzip it. (What I see here is php-7.0.21.tar.bz2)
tar -jxvf php-7.0.21.tar.bz2
Third, enter the corresponding directory
cd php-7.0.21/ext/fileinfo/
Enter the corresponding fileinfo directory, and then execute the command:
/usr/local/php/bin/phpize
Fourth, compilation and execution
./configure –with-php-config=/usr/local/php/bin/php-config
make && make install
Fifth, modify the configuration
vi /usr/local/php/etc/php.ini
In the last line add:
extension=fileinfo.so
Then save and exit.
Sixth, restart to take effect and check
/etc/init.d/php-fpm restart
Restart PHP, and then check whether fileinfo is turned on in phpinfo.
That’s it, done!
Recommended site searches: IP query, Korean server recommendation, foreign trade hosting, China's top ten domain name registrars with the same IP site query, Korean server recommendation, foreign server rental price, host discount code, virtual host 99idc, US domain name registration, < /p>
发表评论