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.
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
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.
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 folder
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
Configure and install
./configure --with-php-config=/www/wdlinux/phps/71/bin/php-config make && make install
After the installation is complete, you will be prompted for a new installation The location where the extension is stored, must remember this location!
#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
##7. Restart the serviceRestart 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!