欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

php使用pecl方式安装扩展操作示例

程序员文章站 2022-05-25 23:02:51
本文实例讲述了php使用pecl方式安装扩展操作。分享给大家供大家参考,具体如下: 安装pecl cd /usr/local/php/bin/ wget ht...

本文实例讲述了php使用pecl方式安装扩展操作。分享给大家供大家参考,具体如下:

安装pecl

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

安装php扩展

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

查询相关扩展

[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

安装相关扩展

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