Linux Environment installation PHP fileinfo extension ____linux

Source: Internet
Author: User
Tags install php php source code
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.