Home  >  Article  >  Backend Development  >  How to install php extension with wdcp

How to install php extension with wdcp

藏色散人
藏色散人Original
2021-07-26 09:25:512065browse

How to install php extensions with wdcp: first determine to download the php version that needs to be installed; then enter the extension directory that needs to be installed; then execute phpize; finally configure and install the PHP extension.

How to install php extension with wdcp

The operating environment of this article: centos7 system, WDCP3.2 version, DELL G3 computer

How to install php extension with wdcp?

WDCP PHP7 install fileinfo extension

wdcp centos7 correctly install the php extension method, take the fileinfo extension as an example

Overview

Generally our wdcp is installed with centos7. The WDCP3.2 version allows multiple versions of PHP to exist, but By default, some extensions are not enabled, such as fileinfo. Many solutions on the Internet say that you can directly find the fileinfo extension in php.ini and remove the comment ';'. In fact, it is useless in most cases, because at the beginning The extension was not installed when installing the system, so the solution is to install it first.

Installation

1. Check the version

First determine the PHP version that needs to be installed. You can see all PHP versions in the wdcp management panel. (Website Management->PHP Management), wdcp3.2 multiple PHP version installation tutorial, you can also see the version here.

2. Determine the location of PHP

Generally, PHP files are under the /www/wdlinux/phps folderHow to install php extension with wdcp

3 , download the corresponding version

Enter the phps directory, and then download the complete version of the php compressed package of the corresponding version. The download address is https://www.php.net/ and find the installation package of the corresponding version

cd /www/wdlinux/phps
wget https://www.php.net/distributions/php-7.1.25.tar.gz
  • Note: If an error occurs, you can add the --no-check-certificate command

      wget --no-check-certificate http://www.php.net/distributions/php-7.1.25.tar.gz

4. Decompression configuration

After downloading the installation package, unzip it

tar -zxvf php-7.1.25.tar.gz

5. Installation

Enter the extension directory of the installation package

cd php-7.1.25/ext

Enter the extension that needs to be installed Directory

ls
cd fileinfo/

Execute phpize,

/www/wdlinux/phps/71/bin/phpize

How to install php extension with wdcp

Configure and install

./configure --with-php-config=/www/wdlinux/phps/71/bin/php-config
make && make install

How to install php extension with wdcp
After the installation is complete, you will be prompted for a new installation The location where the extension is stored, must remember this location!
How to install php extension with wdcp

#6. Modify php.ini

Enter the PHP management panel, modify php.ini and add a paragraph at the end

extension=/www/wdlinux/phps/71/lib/php/extensions/no-debug-non-zts-20160303/fileinfo.so

How to install php extension with wdcp
How to install php extension with wdcp

##7. Restart the service

Restart PHP, and then check phpinfo()

Recommended learning: "

PHP Video Tutorial"

The above is the detailed content of How to install php extension with wdcp. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn