This reverts commit 4b22c3e3ad.
As quick measure for GH-10753, that test was skipped on Windows.
However, it seems that there are no longer performance issues with
newer cURL versions, so we run that test again on Windows.
Fixes GH-10753.
Closes GH-14998.
PR #13498 bumped the required OpenSSL version to 1.1.1, but apparently
only for non Windows system. We catch up somewhat by dropping support
for OpenSSL < 1.1.0 on Windows; besides completely removing detection
of old OpenSSL versions in `SETUP_OPENSSL`, we also ensure that all
bundled extension using this function do no longer accept OpenSSL <
1.1.0, to avoid to still be able to build these extensions with older
`phpize` scripts.
We do not cater to `--phar-native-ssl` yet; that might better be
addressed by #14578.
Closes GH-14973.
- CS synced
- When checking for libcurl linked against old OpenSSL the LIBS can be
used instead of LDFLAGS to put -lcurl to proper place. Also, flags
manipulation variables are wrapped in the AC_CACHE_CHECK commands
because there is also OpenSSL setup done later in the code which
changes LDFLAGS, LIBS and/or CFLAGS.
- CFLAGS added to the check to have edge case of -I flags of custom
installation paths taken into consideration
- All macro arguments quoted
- SSL check simplified a bit
- The HAVE_CURL symbol help text synced
* Include from build dir first
This fixes out of tree builds by ensuring that configure artifacts are included
from the build dir.
Before, out of tree builds would preferably include files from the src dir, as
the include path was defined as follows (ignoring includes from ext/ and sapi/) :
-I$(top_builddir)/main
-I$(top_srcdir)
-I$(top_builddir)/TSRM
-I$(top_builddir)/Zend
-I$(top_srcdir)/main
-I$(top_srcdir)/Zend
-I$(top_srcdir)/TSRM
-I$(top_builddir)/
As a result, an out of tree build would include configure artifacts such as
`main/php_config.h` from the src dir.
After this change, the include path is defined as follows:
-I$(top_builddir)/main
-I$(top_builddir)
-I$(top_srcdir)/main
-I$(top_srcdir)
-I$(top_builddir)/TSRM
-I$(top_builddir)/Zend
-I$(top_srcdir)/Zend
-I$(top_srcdir)/TSRM
* Fix extension include path for out of tree builds
* Include config.h with the brackets form
`#include "config.h"` searches in the directory containing the including-file
before any other include path. This can include the wrong config.h when building
out of tree and a config.h exists in the source tree.
Using `#include <config.h>` uses exclusively the include path, and gives
priority to the build dir.
- One excessive AC_MSG_RESULT removed
- AC_RUN_IFELSE wrapped in AC_CACHE_CHECK for easier cross-compiling
edge cases
- Check wrapped in the thread safety condition since this is relevant
only when ZTS is enabled
Curl changed the behaviour, from the changelog:
- lib: make protocol handlers store scheme name lowercase curl/curl@c294f9c
From the docs: "The returned scheme might be upper or lowercase. Do
comparisons case insensitively."
Closes GH-14312.
* ext/curl: Convert handlers.progress to just be a FCC
* ext/curl: Convert handlers.sshhostkey to just be a FCC
* ext/curl: Convert handlers.xferinfo to just be a FCC
* ext/curl: Convert handlers.fnmatch to just be a FCC
* ext/curl: Convert handlers.server_push to just be a FCC
* ext/curl: Convert php_curl_write to just use FCC without a function name zval
* ext/curl: Convert php_curl_read to just use FCC without a function name zval
* ext/curl: Remove workaround for old libcurl
* ext/curl: Create macros to codegen the handling of callable options
- Remove a check for an always-true curl version check
- Remove a `TODO` comment for curl_version_info check that should be always available since libcurl 7.10
The `phpinfo()` section of the Curl extension lists individual features
supported by the particular ext-Curl + libcurl build. However, the
`curl_version()` function return values do not indicate the same level of
details.
`curl_version()` has a `protocols` key that returns an array of all protocols
supported by the build. But the `features` key is a bitmask of all the features.
Checking the availability of certain feature requires knowing the corresponding
`CURL_VERSION` constant, and checking the availability of the constant and a
bitmask check for it in the `features` value.
For example, to determine HTTP2 support, it requires evaluating:
```php
defined('CURL_VERSION_HTTP2') && (curl_version()['features'] & CURL_VERSION_HTTP2 === CURL_VERSION_HTTP2)
```
To make feature availability checks more intuitive, this adds a new
`feature_list` key to `curl_version()` output array.
With it, checking for individual features availability is easier, and does
not require inspecting the availability of the `CURL_VERSION` constant and
the `features` key.
```php
!empty(curl_version()['feature_list']['HTTP2']);
```
Following 68f6ab7113, the ext/curl doesn't
need to be linked against OpenSSL anymore, if curl_version_info_data
ssl_version is OpenSSL/1.1 or later.
With OpenSSL 3 and later the check for old SSL crypto locking callbacks
was detected here.
This also uses a common PHP_SETUP_OPENSSL macro for checking OpenSSL and
syncs the minimum OpenSSL version (currently 1.0.2 or later) across the
PHP build system.
Bumps the minimum required libcurl version to 7.61.0.
Please also see #4917, which bumped minimum libcurl version to the current >= 7.29.0.
This bumps the minimum requirement to Curl 7.61.0 (released 2018 Sept).
Ubuntu, Debian, RHEL, and RHEL derivatives have major and LTS version bumps this year. Following are the
libcurl-dev/libcurl-devel versions available in the oldest supported (LTS or otherwise) in major OSs.
- Debian buster: [7.64](https://packages.debian.org/buster/libcurl4-openssl-dev)
- Ubuntu 20.04: [7.68](https://packages.ubuntu.com/focal/libcurl-dev)
- CentOS/RHEL 7: 7.29
- RHEL 8/Rocky 8/EL 8: 7.61
- Fedora 38: 7.87
RHEL/CentOS 7 reaches EOL mid 2024, so for PHP 8.4 scheduled towards the end of this year, we can safely
bump the minimum libcurl version.
7.61.0 was selected as the new minimum because RHEL and derivatives have libcurl-devel version 7.61. RHEL 8 is
a current and supported RHEL version.
The `sync_constants.php` file uncovers constants present in libcurl source, but\
not present in PHP ext/curl source. There is a regular expression to match
Curl constants, but to it did not previously include `CURLE_*` and `CURLINFO_*`
constants, which PHP should expose as constants.
This updates the `sync_constants.php` file's constant filter regex to expose those
constants patterns as well. The new missing constants will be added in a later PR.
* missing SKIP_ONLINE_TESTS
gethostbynamel may contact DNS servers, so it should be skipped if SKIP_ONLINE_TESTS , and on a AMD Ryzen 9 7950x WSL Ubuntu this test took ~2 seconds (some DNS timeout i guess?) so it should also have SKIP_SLOW_TESTS
* error message nitpick