Home  >  Article  >  Backend Development  >  Detailed explanation of the steps to install extensions in PHP through pecl method

Detailed explanation of the steps to install extensions in PHP through pecl method

php中世界最好的语言
php中世界最好的语言Original
2018-05-19 11:37:392244browse

This time I will bring you php through pecl method InstallationDetailed explanation of the extension steps, php through pecl method to install extensionsNotesWhat are the practical cases below, let’s take a look one time.

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

# cd /usr/local/php/bin/  //可查看是否已带有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. Check whether the extension has been included

# pecl search swoole  // swoole为要查询扩展名(以swoole扩展为例) 
//查询结果: 
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 and configure the extension

# pecl install swoole 
//输出结果: 
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 
 
# 配置php.ini引用swoole.so然后重启php即可

Note: Compared with phpize installation, pecl installation is simpler and can save the need to manually add to php.ini

The above php is installed through pecl The Example explanation of how to install the extension is all the content shared by the editor. I hope it can give you a reference, and I also hope you will support Script Home.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Detailed explanation of the steps to implement QQ login in PHP

Detailed explanation of the steps to use mb_strpos in PHP

The above is the detailed content of Detailed explanation of the steps to install extensions in PHP through pecl method. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn