PHP编译curl拓展报错的原因

有段时间手痒,就想通过源码安装,然后一个个拓展安装,很多拓展安装的很顺利,但是curl貌似报了错误 

In file included from /usr/local/php7.3/include/php/main/php.h:468:0,
                 from /home/download/php-7.3.7/ext/curl/interface.c:25:
/home/download/php-7.3.7/ext/curl/interface.c: In function ‘zm_startup_curl’:
/home/download/php-7.3.7/ext/curl/interface.c:1403:25: error: ‘CURLAUTH_GSSAPI’ undeclared (first use in this function)
  REGISTER_CURL_CONSTANT(CURLAUTH_GSSAPI);
                         ^
/usr/local/php7.3/include/php/Zend/zend_constants.h:53:105: note: in definition of macro ‘REGISTER_LONG_CONSTANT’
 #define REGISTER_LONG_CONSTANT(name, lval, flags)  zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
                                                                                                         ^
/home/download/php-7.3.7/ext/curl/interface.c:1403:2: note: in expansion of macro ‘REGISTER_CURL_CONSTANT’
  REGISTER_CURL_CONSTANT(CURLAUTH_GSSAPI);
  ^
/home/download/php-7.3.7/ext/curl/interface.c:1403:25: note: each undeclared identifier is reported only once for each function it appears in
  REGISTER_CURL_CONSTANT(CURLAUTH_GSSAPI);
                         ^
/usr/local/php7.3/include/php/Zend/zend_constants.h:53:105: note: in definition of macro ‘REGISTER_LONG_CONSTANT’
 #define REGISTER_LONG_CONSTANT(name, lval, flags)  zend_register_long_constant((name), sizeof(name)-1, (lval), (flags), module_number)
                                                                                                         ^
/home/download/php-7.3.7/ext/curl/interface.c:1403:2: note: in expansion of macro ‘REGISTER_CURL_CONSTANT’
  REGISTER_CURL_CONSTANT(CURLAUTH_GSSAPI);
  ^
Makefile:194: recipe for target 'interface.lo' failed
make: *** [interface.lo] Error 1

以上我通过phpize安装curl拓展报的错误。

那么这是什么原因,有的人说是源码错误,需要修改,我觉得这个答案正确率非常低,因为我是从官方网站下载下来的源码,理论上不会出错。

那么是不是自己的curl安装有问题呢,想想好像也不太可能,因为我当时环境存在了php7.1.7的版本,跑的挺正常的。那么可能的问题是高版本和现在环境的curl版本不兼容,既然有疑问,那么我们动手试一试。

安装下最新的curl版本

下载地址:https://curl.haxx.se/download.html

我下载的是curl-7.65.1.tar.gz这个版本,因为它是最新的,我就喜欢最新的版本,只要不是bate版本。

configure安装

省略编译代码提示若干~~~~~~

此过程正常(如果不正常,那么需要找原因,这么不阐述)

然后make && make install

ok 回头,我们再进入ext/curl  进行安装,发现可以了。。

在extensions/no-debug-non-zts-xxx下面出现了curl.so文件。然后添加php.ini 。

 

 

转载于:https://my.oschina.net/jishuge/blog/3070408

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值