Explanation of php Installation Extension by pecl

  • 2021-09-04 23:47:28
  • OfStack

1. Install pecl and create shortcut keys (if php is installed with this installation step, you can ignore it)


# cd /usr/local/php/bin/  // You can see if you have pecl 
# wget http://pear.php.net/go-pear.phar -O go-pear.php 
# php go-pear.php 
# ln -s /usr/local/php 
/bin/pecl /usr/bin/pecl 

2. Query whether the extension has been included


# pecl search swoole  // swoole For the extension to be queried (with swoole Expand as an example)  
// Query results:  
Retrieving data...0% 
.Matched packages, channel pecl.php.net: 
======================================= 
Package Stable/(Latest) Local 
swoole 1.9.23 (stable) Event-driven asynchronous and concurrent networking engine with high performance for PHP. 
swoole_serialize 0.1.1 (beta) the fastest and smallest serialize fucntion bound for php7 

3. Install configuration extensions


# pecl install swoole 
// Output:  
Build process completed successfully 
Installing '/usr/lib64/php/modules/swoole.so' 
install ok: channel://pecl.php.net/swoole-1.9.23 
configuration option "php_ini" is not set to php.ini location 
You should add "extension=swoole.so" to php.ini 
 
#  Configure php.ini Quote swoole.so Then restart php You can  

Note: Compared with phpize installation, pecl installation is simpler, and manual addition to php. ini can be omitted


Related articles: