有段时间手痒,就想通过源码安装,然后一个个拓展安装,很多拓展安装的很顺利,但是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 。