我们安装个:pecl_http扩展试下
代码[root@localhost ~]# pecl search http
Retrieving data...0%
Matched packages, channel pecl.php.net:
=======================================
Package Stable/(Latest) Local
pecl_http 1.7.0 (stable) Extended HTTP Support
You have new mail in /var/spool/mail/root
[root@localhost ~]# pecl install pecl_http
downloading pecl_http-1.7.0.tgz ...
Starting to download pecl_http-1.7.0.tgz (173,979 bytes)
.....................................done: 173,979 bytes
source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
whether to enable cURL HTTP requests; specify libcurl directory [yes] :先运行:search 命令模糊搜索,然后可以用,pecl install pecl_http .
一路回车,一会儿 在:
[root@localhost ~]# ll /usr/lib/php/modules/http.so
-rw-r--r-- 1 root root 1274476 06-26 08:56 /usr/lib/php/modules/http.so
存在自己的模块了。(不同系统,位置可能不同),上一步安装完后,会告诉模块所在地址。
3.配制php.ini
加入:
extension=http.so
就ok了。
然后,可以通过php -m 查看下。
[root@localhost ~]# php -m
[PHP Modules]
bz2
calendar
ctype
curl
date
dbase
dom
eAccelerator
exif
filter
ftp
gd
gettext
gmp
hash
http
。。。。。。。。。。。。。
已经安装成功。 后记:其它也有源码安装,上pecl.php.net 找到对应源码包解压。可以通过:pecl install 源码文件。 一样ok.