Doc #81661 [Com]: curl uses pkg-config as of PHP 7.4.0

[email protected] ("gallgeborg at gmail dot com") Tue, 27 Dec 2022 09:18:30 +0000
Newsgroups php.doc.bugs
Message-ID <[email protected]>
Edit report at https://bugs.php.net/bug.php?id=81661&edit=1

 ID:                 81661
 Comment by:         gallgeborg at gmail dot com
 Reported by:        oliver at erply dot com
 Summary:            curl uses pkg-config as of PHP 7.4.0
 Status:             Re-Opened
 Type:               Documentation Problem
 Package:            cURL related
 Operating System:   Centos 7
 PHP Version:        8.0.13
 Block user comment: N
 Private report:     N

 New Comment:

I'm happy to see the issue is soon regulated. Thankful to you for supporting us with the outcome. (https://www.cfa-home.com/)github.com


Previous Comments:
------------------------------------------------------------------------
[2021-12-28 10:09:07] [email protected]

Good news, but this ticket should stay open until the docs are
updated.

------------------------------------------------------------------------
[2021-12-28 07:41:38] oliver at erply dot com

Thanks, I was now able to compile the package.

------------------------------------------------------------------------
[2021-11-26 13:28:01] [email protected]

> --with curl=/opt/ews-24-80/curl

As of PHP 7.4.0, that argument is ignored; instead, pkg-config is
used to find the location of libcurl, and in your case it likely
finds an older version somewhere else.  Use PKG_CONFIG_PATH to
tell pkg-config where to look for your desired libcurl version.

Anyhow, that pkg-config change is not documented for curl yet[1],
so I'm switching to doc issue.

[1] <https://www.php.net/manual/en/curl.installation.php>

------------------------------------------------------------------------
[2021-11-26 12:53:07] oliver at erply dot com

Description:
------------
I compiled PHP version 8.0.13 with following options:

./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --prefix=/opt/ews-24-80/php --libdir=/opt/ews-24-80/php/lib64 --with-config-file-path=/usr/local/etc/ews-24-80/php --with-apxs2=/opt/ews-24-80/apache2/bin/apxs --with-openssl --with-libxml-dir --with-pcre-regex --with-zlib --with curl=/opt/ews-24-80/curl


There are no errors indicating anything went wrong in the compiling process, however when running the test script shared below I get an error with Undefined constant. Using /opt/ews-24-80/curl directly from the CLI works fine.

CURL version used: 7.80.0

Same setup works fine with PHP 7.3

Test script:
---------------
<?php
print_r(CURLINFO_TOTAL_TIME_T);
?>

Expected result:
----------------
Get the actual value of CURLINFO_TOTAL_TIME_T constant.

Actual result:
--------------
#0 {main}
  thrown in /curl.php on line 2

Fatal error: Uncaught Error: Undefined constant "CURLINFO_TOTAL_TIME_T" in /curl.php on line 2

Error: Undefined constant "CURLINFO_TOTAL_TIME_T" in /curl.php on line 2

Call Stack:
    0.0003     390752   1. {main}() /curl.php:0


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81661&edit=1