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:
-
From the official website to find the extensions needed: in the station extension to search
-
Enter the link after you find it (the purple part of the picture above)
-
Right-click on the required version and select copy link address
-
Enter the command in linux to download the expansion package:
wget http://pecl.php.net/get/docblock-0.2.0.tgz
-
Unzip and enter the directory:
tar -zxf docblock-0.2.0.tgz cd docblock-0.2.0
-
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/php
view the installed version directory, and use tophp -v
view the currently used version -
Compile and install
make && make install make test
-
Write configuration file
echo "extension = docblock.so" >> /www/server/php/72/etc/php.ini
Note that you
docblock.so
should write the name of the extension you installed here , and similarly change the directory to the version directory of your own corresponding php -
Reload php (pay attention to change the version directory)
/etc/init.d/php-fpm-72 reload
-
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