编译安装,发现本地还没有phpize,两种方法安装phpize:
第一种:
需要先下载对应的php版本包,然后包中就有phpize:
我的php版本是5.3.3
第二种:
也可以使用yum install php-devel安装phpize
安装成功之后重新到pecl目录下phpize,之后./configure。报错如下:
configure: error: Please install pecl/raphf and activate extension=raphf.so in your php.ini
这里有解决方法:
然后去pecl网站重新下载安装了两个包:
raphf
propro
然后./configure成功之后,make的时候报错。
一大堆错误提示里看到pcre.h没有什么的。
安装yum install pcre-devel
之后make成功!
make test
make install
就可以了:
[root@LAMP1 pecl_http-2.5.0]# make install
Installing shared extensions: /usr/lib64/php/modules/
Installing header files: /usr/include/php/
[root@LAMP1 pecl_http-2.5.0]# pecl
最后我们到这里看:
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
[root@LAMP1 modules]# ll
总用量 2816
-rwxr-xr-x. 1 root root 29584 10月 31 2014 bcmath.so-rwxr-xr-x. 1 root root 66096 10月 31 2014 curl.so-rwxr-xr-x. 1 root root 1843056 10月 31 2014 fileinfo.so-rwxr-xr-x. 1 root root 36200 10月 31 2014 json.so-rwxr-xr-x. 1 root root 136832 10月 31 2014 mysqli.so-rwxr-xr-x. 1 root root 54408 10月 31 2014 mysql.so-rwxr-xr-x. 1 root root 30112 10月 31 2014 pdo_mysql.so-rwxr-xr-x. 1 root root 102456 10月 31 2014 pdo.so-rwxr-xr-x. 1 root root 24640 10月 31 2014 pdo_sqlite.so-rwxr-xr-x. 1 root root 261392 10月 31 2014 phar.so-rwxr-xr-x. 1 root root 61787 7月 9 16:38 propro.so-rwxr-xr-x. 1 root root 75713 7月 9 16:34 raphf.so-rwxr-xr-x. 1 root root 44368 10月 31 2014 sqlite3.so-rwxr-xr-x. 1 root root 83088 10月 31 2014 zip.so[root@LAMP1 modules]# ll
总用量 4592
-rwxr-xr-x. 1 root root 29584 10月 31 2014 bcmath.so-rwxr-xr-x. 1 root root 66096 10月 31 2014 curl.so-rwxr-xr-x. 1 root root 1843056 10月 31 2014 fileinfo.so-rwxr-xr-x. 1 root root 1818519 7月 9 16:47 http.so-rwxr-xr-x. 1 root root 36200 10月 31 2014 json.so-rwxr-xr-x. 1 root root 136832 10月 31 2014 mysqli.so-rwxr-xr-x. 1 root root 54408 10月 31 2014 mysql.so-rwxr-xr-x. 1 root root 30112 10月 31 2014 pdo_mysql.so-rwxr-xr-x. 1 root root 102456 10月 31 2014 pdo.so-rwxr-xr-x. 1 root root 24640 10月 31 2014 pdo_sqlite.so-rwxr-xr-x. 1 root root 261392 10月 31 2014 phar.so-rwxr-xr-x. 1 root root 61787 7月 9 16:38 propro.so-rwxr-xr-x. 1 root root 75713 7月 9 16:34 raphf.so-rwxr-xr-x. 1 root root 44368 10月 31 2014 sqlite3.so-rwxr-xr-x. 1 root root 83088 10月 31 2014 zip.so[root@LAMP1 modules]#
发现多了一个http.so,把这个加到php.ini里就行了:
extension=http.so