curlfile扩展 php_PHP静态编译开启curl扩展总是失败

编译参数

仅测试curl静态编译,所以编译参数如下:

./configure LDFLAGS="-static -static-libgcc" \

--prefix=/usr/local/php/php7.4.4/ \

--with-config-file-path=/usr/local/php/php7.4.4/ \

--with-libdir=lib/x86_64-linux-gnu \

--disable-all \

--with-curl

或者手动指定 curl 路径

./configure LDFLAGS="-static -static-libgcc" \

--prefix=/usr/local/php/php7.4.4/ \

--with-config-file-path=/usr/local/php/php7.4.4/ \

--with-libdir=lib/x86_64-linux-gnu \

--disable-all \

--with-curl=/usr/local/curl

报错内容

在 configure 阶段就产生的错误:

gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)

configure:4454: $? = 0

configure:4443: cc -V >&5

cc: error: unrecognized command line option '-V'

cc: fatal error: no input files

compilation terminated.

configure:4454: $? = 1

configure:4443: cc -qversion >&5

cc: error: unrecognized command line option '-qversion'; did you mean '--version'?

cc: fatal error: no input files

...

configure:4970: cc -E conftest.c

conftest.c:9:10: fatal error: ac_nonexistent.h: No such file or directory

#include

^~~~~~~~~~~~~~~~~~

compilation terminated

...

configure:5373: checking minix/config.h usability

configure:5373: cc -c -g -O2 conftest.c >&5

conftest.c:52:10: fatal error: minix/config.h: No such file or directory

#include

^~~~~~~~~~~~~~~~

compilation terminated

...

configure:6393: checking for pthreads_cflags

configure:6423: cc -o conftest -g -O2 -fvisibility=hidden -kthread -static -static-libgcc conftest.c >&5

cc: error: unrecognized command line option '-kthread'; did you mean '-pthread'?

configure:6423: $? = 1

configure: failed program was:

...

configure:7260: cc -o conftest -g -O2 -fvisibility=hidden -static -static-libgcc conftest.c >&5

/tmp/ccKajTU1.o: In function `main':

/mnt/tools/php-7.4.4/conftest.c:62: undefined reference to `setproctitle'

collect2: error: ld returned 1 exit status

系统环境

Debian9、CentOS8 均能复现出问题

安装过 libcurl-devel

yum install -y libcurl-devel

automake、autoconf、libtool、gcc 版本:

# rpm -qf /usr/bin/autoconf

autoconf-2.69-27.el8.noarch

# automake --version

automake (GNU automake) 1.16.1

# libtool --version

libtool (GNU libtool) 2.4.6

# gcc -v

gcc version 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC)

麻烦各位给予解答或者帮助,感谢!

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值