扩展帮助地址:https://mdref.m6w6.name/http
使用pecl安装,提示没有对应的库。只能用phpize底层编译安装。
安装过程:
1.从pecl网站下载pecl_http扩展。
地址:http://pecl.php.net/package/pecl_http
2.解压安装pecl。
tar zxvf pecl_http-2.5.5.tgz
3.进入解压后的文件夹,使用phpize配置编译环境。
phpize
4.编译安装
./configure
make
make test
make install
注意./configure过程中可能提示需要安装另外的扩展。此次安装提示 proro和raphf未安装。
直接使用pecl安装,安装后配置php.ini。
extension = "raphf.so"
extension = "propro.so"
安装后继续./configure即可。
其中make test步骤可能会提示php.ini中禁止了相应的函数。在disable_functions中去掉即可。
5.将http.so拷贝至php的扩展目录(php.ini中的extension_dir),并在php.ini中添加对应的扩展。
extension = "http.so"