用curl编译php,curl安装在哪里?

2022-01-04 00:00:00 compilation installation linux curl php

--with-curl=

curl 二进制文件位于 /usr/bin/curl

The curl binary is located at /usr/bin/curl

curl -V 给我

curl 7.15.5 (x86_64-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

locate curl 给我

/usr/bin/curl
/usr/lib/libcurl.so.3
/usr/lib/libcurl.so.3.0.0
/usr/lib64/libcurl.so.3
/usr/lib64/libcurl.so.3.0.0

删除了/usr/share/... 和其他不相关的文件

更新

尝试了 --with-curl=/usr/lib64--with-curl=/usr/lib 虽然我很确定它是 64 位的.

Tried --with-curl=/usr/lib64 and --with-curl=/usr/lib although I'm pretty sure it's 64 bit.

checking for cURL support... yes
checking if we should use cURL for url streams... no
checking for cURL in default path... not found
configure: error: Please reinstall the libcurl distribution -
    easy.h should be in <curl-dir>/include/curl/

解决方案

PHP 需要 curl-devel

PHP requires curl-devel

推荐答案

这些都不允许您在启用 cURL 的情况下编译 PHP.

None of these will allow you to compile PHP with cURL enabled.

为了使用 cURL 进行编译,您需要 libcurl 头文件(.h 文件).它们通常位于 /usr/include/curl 中.它们通常捆绑在一个单独的开发包中.

In order to compile with cURL, you need libcurl header files (.h files). They are usually found in /usr/include/curl. They generally are bundled in a separate development package.

例如,在 Ubuntu 中安装 libcurl:

Per example, to install libcurl in Ubuntu:

sudo apt-get install libcurl4-gnutls-dev

或 CentOS:

sudo yum install curl-devel

然后你可以这样做:

./configure --with-curl # other options...

如果您手动编译 cURL,您可以指定不带 libinclude 后缀的文件路径.(例如:/usr/local 如果 cURL 标头在 /usr/local/include/curl 中).

If you compile cURL manually, you can specify the path to the files without the lib or include suffix. (e.g.: /usr/local if cURL headers are in /usr/local/include/curl).

相关文章