Install php extension on pagoda panel

The php installed on the pagoda panel is slightly different from the default php installation location and directory settings

View the currently installed extensions of php:

php -m

View the extension installation directory:

php -i | grep extension_dir

Check whether a specific extension (take openssl as an example) has been installed:

php -m | grep openssl

Let's take the extension docblock as an example to demonstrate the installation of the php extension:

  1. From the official website to find the extensions needed: in the station extension to search
    Insert picture description here

  2. Enter the link after you find it (the purple part of the picture above)
    Insert picture description here

  3. Right-click on the required version and select copy link address

  4. Enter the command in linux to download the expansion package:

    wget http://pecl.php.net/get/docblock-0.2.0.tgz
    
  5. Unzip and enter the directory:

    tar -zxf docblock-0.2.0.tgz
    cd docblock-0.2.0
    
  6. Build configuration

    /www/server/php/72/bin/phpize
    ./configure --with-php-config=/www/server/php/72/bin/php-config
    

    Note that my php version here is 72, different versions choose different paths, such as version 56. The above command is /www/server/php/56/bin/phpize. You can enter to /www/server/phpview the installed version directory, and use to php -vview the currently used version

  7. Compile and install

    make && make install
    make test
    
  8. Write configuration file

    echo "extension = docblock.so" >> /www/server/php/72/etc/php.ini
    

    Note that you docblock.soshould write the name of the extension you installed here , and similarly change the directory to the version directory of your own corresponding php

  9. Reload php (pay attention to change the version directory)

    /etc/init.d/php-fpm-72 reload
    

    Insert picture description here

  10. Check whether the installation is successful:

    /www/server/php/72/bin/php -m|grep -i docblock
    

Reference from blog

You can also directly enter the pagoda panel to install: software store-"select the corresponding php version-"install the extension
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44559752/article/details/109837887