php Installs Extension Action Sample Using pecl
- 2021-12-19 06:00:12
- OfStack
This article illustrates how php installs extensions using pecl. Share it for your reference, as follows:
Installing pecl
cd /usr/local/php/bin/
wget http://pear.php.net/go-pear.phar -O go-pear.php
php go-pear.php
## Enter default installation
Installing php extensions
pecl search key-word # Used to find extensions
pecl install key-word # Used to install extensions
Query related extension
[root@localhost src]# pecl search swoole
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
swoole 1.8.12 (stable) 1.8.12 Event-driven asynchronous and concurrent networking engine with high performance for PHP.
[root@localhost src]# pecl search xdebug
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
xdebug 2.4.1 (stable) Provides functions for function traces and profiling
Install related extensions
pecl install xdebug
## After the installation is complete, output
Build process completed successfully
Installing '/usr/lib64/php/modules/xdebug.so'
install ok: channel://pecl.php.net/xdebug-2.4.1
configuration option "php_ini" is not set to php.ini location
You should add "zend_extension=/usr/lib64/php/modules/xdebug.so" to php.ini
## According to the prompt, we are in php.ini The last addition of
zend_extension=/usr/lib64/php/modules/xdebug.so
pecl install swoole
For more readers interested in PHP related contents, please check the topics of this site: "PHP Extended Development Tutorial", "PHP Network Programming Skills Summary", "php curl Usage Summary", "PHP Array (Array) Operation Skills Complete Book", "PHP Data Structure and Algorithm Tutorial", "php Programming Algorithm Summary" and "php String (string) Usage Summary"
I hope this article is helpful to everyone's PHP programming.