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

yipeiwu_com6年前PHP代码库

本文实例讲述了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

更多关于PHP相关内容感兴趣的读者可查看本站专题:《PHP扩展开发教程》、《PHP网络编程技巧总结》、《php curl用法总结》、《PHP数组(Array)操作技巧大全》、《PHP数据结构与算法教程》、《php程序设计算法总结》及《php字符串(string)用法总结

希望本文所述对大家PHP程序设计有所帮助。

相关文章

phpfpm的作用和用法

PHP-FPM(FastCGI Process Manager:FastCGI进程管理器)是一个PHPFastCGI管理器,对于PHP 5.3.3之前的php来说,是一个补丁包 ,旨在将...

php显示时间常用方法小结

本文实例讲述了php显示时间常用方法。分享给大家供大家参考。具体分析如下: 一、PHP函数Date()获取当前时间 代码: 复制代码 代码如下:<?php echo $sh...

PHP响应post请求上传文件的方法

本文实例讲述了PHP响应post请求上传文件的方法。分享给大家供大家参考,具体如下: function send_file($url, $post = '', $file = '')...

PHP入门教程之会话控制技巧(cookie与session)

本文实例讲述了PHP会话控制技巧。分享给大家供大家参考,具体如下: Demo1.php <form method="get" action="Demo2.php">...

PHP时间函数使用详解

PHP开发中,关于时间函数的使用基本上可以说是无处不在,而PHP中操作时间的方法也很多,比如PHP时间戳、日期与时间戳之间的转换、获取当前日期、当前时间之前或之后的时间等等,下面我们详细...