php安装http扩展(sudo apt-get install)

来源:互联网 发布:淘宝轮播图代码 编辑:程序博客网 时间:2024/06/05 03:03

转自:http://www.xwuxin.com/?p=1575点击打开链接

"

上面新需求准备采用kohana,kohana是很早之前从ci分出来的一个框架,轻量,没有像ci那样去兼容php4。kohana需要安装http扩展,在Ubuntu上折腾了下,遇到些问题记录在此:
在安装好pecl的前提下:

sudo apt-get install libcurl3-openssl-dev
sudo apt-get install libmagic-dev

如果你不安装libcurl3-openssl-dev,直接用pecl install pecl-http方式安装http扩展,它会给你报以下error:

checking for curl/curl.h… not found
configure: error: could not find curl/curl.h
ERROR: ‘/tmp/pear/temp/pecl_http/configure –with-http-curl-requests –with-http-zlib-compression=1 –with-http-magic-mime=no –with-http-shared-deps’ failed

configure: error: could not find magic.h
ERROR: `/tmp/pear/temp/pecl_http/configure –with-http-curl-requests –with-http-zlib-compression –with-http-magic-mime –with-http-shared-deps’ failed

接着安装http扩展:

sudo pecl install pecl_http

一路回车之后,完成安装。
打开php.ini,加上extension=http.so,重启你的web服务器即可。


"


注:安装pecl:
$ sudo apt-get install php5-dev php-pear


原创粉丝点击