How to install extensions in php through pecl?

coldplay.xixi
Release: 2023-03-02 19:00:01
Original
3676 people have browsed it

php method to install extensions through pecl: first install pecl and install php extensions; then query related extensions, the code is [[root@localhost src]# pecl search swoole]; finally install the relevant extensions .

How to install extensions in php through pecl?

How to install extensions via pecl:

1. Install pecl

cd /usr/local/php/bin/
wget http://pear.php.net/go-pear.phar -O go-pear.php
php go-pear.php
##回车默认安装
Copy after login

2. Install php extension

pecl search key-word    #用于查找扩展
pecl install key-word   #用于安装扩展
Copy after login

3. Query related extensions

[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
Copy after login

4. Install related extensions

pecl install xdebug
##安装完成之后,输出
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
##根据提示,我们在php.ini的最后添加
zend_extension=/usr/lib64/php/modules/xdebug.so
pecl install swoole
Copy after login

Related learning recommendations: PHP programming from entry to proficiency

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!