logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Other Software View previous topic :: View next topic
Reply to topic   Topic: PHP 8.5.7 and curl 8.20.0 require loading of brotli and zstd
Author
danielruf



Joined: 07 Jan 2026
Posts: 24

PostPosted: Tue 16 Jun '26 8:45    Post subject: PHP 8.5.7 and curl 8.20.0 require loading of brotli and zstd Reply with quote

It seems newer PHP versions (also includes PHP 8.4.x) ship with curl 8.20.0, which requires to load brotli(dec.dll) and (lib)zstd(.dll).

Otherwise Apache fails to start, when one of the newer PHP releases with curl 8.20.0 or newer is used.

Is this on the radar of the ApacheLounge team? Will there be some changes in the ApacheLounge Apache builds or is this just something that has to be documented, so PHP users are aware of it and related bugreports can be pointed to the documentation?

https://github.com/php/php-src/issues/22157
https://github.com/php/php-src/pull/21925
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 758

PostPosted: Wed 17 Jun '26 11:19    Post subject: Reply with quote

It is on our radar.

We build the Lib and the DLL in the next APACHE.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3205
Location: Hilversum, NL, EU

PostPosted: Wed 17 Jun '26 14:57    Post subject: Reply with quote

New version available.

In the changelog :

*) Added ZSTD libraries (zstd.dll, zstdt.exe, zstd.lib, zstd_ststic.lib) to help with third party support.


*) Added ZSTD support in Curl.
Back to top
danielruf



Joined: 07 Jan 2026
Posts: 24

PostPosted: Wed 17 Jun '26 22:44    Post subject: Reply with quote

Hm, I still have to add the following to apache/conf/httpd.conf to have curl loaded according to phpinfo():

LoadFile "${basePath}/php/brotlidec.dll"
LoadFile "${basePath}/php/libzstd.dll"

So did I mix something up and this has to be manually done even with your latest changes? What is the preferred solution for users running PHP 8.5.7 on Apache 2.4.68 from 17th of June 2026?
Back to top
danielruf



Joined: 07 Jan 2026
Posts: 24

PostPosted: Wed 17 Jun '26 22:50    Post subject: Reply with quote

not relevant probablx, but there were some changes affecting zlib dll names: https://github.com/php/php-src/issues/22157#issuecomment-4734454260

Last edited by danielruf on Thu 18 Jun '26 19:57; edited 1 time in total
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 458
Location: UK

PostPosted: Thu 18 Jun '26 0:08    Post subject: Reply with quote

danielruf wrote:
Hm, I still have to add the following to apache/conf/httpd.conf to have curl loaded according to phpinfo():

LoadFile "${basePath}/php/brotlidec.dll"
LoadFile "${basePath}/php/libzstd.dll"

Apache has shipped with brotlidec.dll for a long time now, so the fact you're having to name a specific path to a brotlidec.dll image with a LoadFile directive, is somewhat surprising.

Also notable, when building zstd with CMake (as per the new AL build), the default DLL filename produced by the package is zstd.dll not libzstd.dll
    Install the project...
    -- Install configuration: "Release"
    -- Installing: C:/Apache24/lib/pkgconfig/libzstd.pc
    -- Installing: C:/Apache24/include/zdict.h
    -- Installing: C:/Apache24/include/zstd.h
    -- Installing: C:/Apache24/include/zstd_errors.h
    -- Installing: C:/Apache24/lib/zstd.lib
    -- Installing: C:/Apache24/bin/zstd.dll
    -- Installing: C:/Apache24/lib/zstd_static.lib
    -- Installing: C:/Apache24/bin/zstd.exe
    -- Installing: C:/Apache24/lib/cmake/zstd/zstdTargets.cmake
    -- Installing: C:/Apache24/lib/cmake/zstd/zstdTargets-release.cmake
    -- Installing: C:/Apache24/lib/cmake/zstd/zstdConfig.cmake
    -- Installing: C:/Apache24/lib/cmake/zstd/zstdConfigVersion.cmake
What happens if you specify:
Code:
LoadFile "bin/brotlidec.dll"
LoadFile "bin/zstd.dll"

Does this satisfy your PHP startup requirements?

If not, to me it rather looks like there's a specific link requirement with the PHP CURL configuration.
Back to top
danielruf



Joined: 07 Jan 2026
Posts: 24

PostPosted: Thu 18 Jun '26 8:49    Post subject: Reply with quote

following tried:

LoadFile "bin/brotlidec.dll"
LoadFile "bin/zstd.dll"

Results in:

[18-Jun-2026 06:41:40 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: C:\...\php\ext\curl (Das angegebene Modul wurde nicht gefunden), C:\...\php\ext\php_curl.dll (Das angegebene Modul wurde nicht gefunden)) in Unknown on line 0


Tried:

LoadFile "/bin/brotlidec.dll"
LoadFile "/bin/zstd.dll"

Leads to the Apache Service not starting on Windows (Fails with an error:

Der Dienst "apache2.4" wurde mit dem folgenden dienstspezifischen Fehler beendet:
Unzulässige Funktion.


Tried:

LoadFile "${basePath}/apache/bin/brotlidec.dll"
LoadFile "${basePath}/apache/bin/zstd.dll"

Results in:

[18-Jun-2026 06:45:28 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'curl' (tried: C:\...\php\ext\curl (Das angegebene Modul wurde nicht gefunden), C:\...\php\ext\php_curl.dll (Das angegebene Modul wurde nicht gefunden)) in Unknown on line 0

Only the following works for me and adds the curl section in the Output of phpinfo():

LoadFile "${basePath}/php/brotlidec.dll"
LoadFile "${basePath}/php/libzstd.dll"
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 758

PostPosted: Thu 18 Jun '26 11:13    Post subject: Reply with quote

Just try only the zstd.dll and libzstd.dll.

brotli we have it already for years.

We build from zstd-1.5.7.tar.gz from the bottom of page https://github.com/facebook/zstd/releases.

And have no libzstd.dll
Back to top
danielruf



Joined: 07 Jan 2026
Posts: 24

PostPosted: Thu 18 Jun '26 12:21    Post subject: Reply with quote

Quote:
Just try only the zstd.dll and libzstd.dll.
...
And have no libzstd.dll


I'm not sure I understand.

My question basically boils down to: why do we even have to manually add some LoadFile entries for the curl extension?

Is this expected and if so, should this be documented somewhere? Why was zstd then included but I still need the LoadFile entry?

I'm currently on your latest build with 2.4.68 (httpd-2.4.68-260617-Win64-VS18).
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 758

PostPosted: Thu 18 Jun '26 13:02    Post subject: Reply with quote

Just try only to include zstd, to see if the issue is brotli or zstd

I think it is a PHP issue. The way it is build causes add some LoadFile.
Back to top
danielruf



Joined: 07 Jan 2026
Posts: 24

PostPosted: Thu 18 Jun '26 13:10    Post subject: Reply with quote

Understood, thank you.

I've now added only the following, instead of brotlidec + libzstd:

LoadFile "${basePath}/php/libzstd.dll"

This seems to work (we generally load the versions shipped with the PHP builds for Windows).

I'll try to report the requirement for this LoadFile in the PHP project. Maybe ther eis something that can be fixed / improved. At least to me it makes not much sense to manually add this, when the libraries are there in Apache and PHP is running as Apache module.

Edit: opened an issue at https://github.com/php/php-src/issues/22359 - maybe some mismatch leads to this
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 458
Location: UK

PostPosted: Thu 18 Jun '26 23:02    Post subject: Reply with quote

danielruf wrote:
I've now added only the following, instead of brotlidec + libzstd:

LoadFile "${basePath}/php/libzstd.dll"

I've been looking into this issue and trying to reason it through.

Since you say your setup works without specifying the PHP based brotlidec.dll file, that rather suggests it's happy with the Apache bundled version (which I'd expect).

So out of interest, I wonder what happens if you copy the Apache zstd.dll to a file named libzstd.dll, whether Apache will then start without the extra PHP LoadFile directive?

For some reason it would seem the PHP (8.5.7) build process (winlib-builder) chooses a different name for the ZSTD libraries compared to those which come with the standard CMake build on Windows.
Code:
    ZSTD                 PHP
    -----                -----
    zstd.dll             libzstd.dll
    zstd.lib             libzstd.lib

Hence the php_curl.dll file expects to find libzstd.dll, as confirmed here, viz:
Code:
C:\>dumpbin /dependents C:\php-8.5.7\ext\php_curl.dll | more
Microsoft (R) COFF/PE Dumper Version 14.51.36246.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file C:\php-8.5.7\ext\php_curl.dll

File Type: DLL

  Image has the following dependencies:

    php8.dll
    IPHLPAPI.DLL
    Secur32.dll
    libcrypto-3-x64.dll
    libssl-3-x64.dll
    CRYPT32.dll
    WLDAP32.dll
    Normaliz.dll
    libssh2.dll
    nghttp2.dll
    brotlidec.dll
    libzstd.dll
    KERNEL32.dll
    ADVAPI32.dll
    WS2_32.dll
    VCRUNTIME140.dll

But interestingly, looking at the PHP libzstd.dll file, the winlib-builder process listed appears to be CMake based too, viz:
Code:
C:\>link /dump /headers C:\php-8.5.7\libzstd.dll | grep cv
    69D4DC64 cv            6E 000CA29C    C969C    Format: RSDS, {59375754-5C1E-4BB8-947F-581DA94941A9}, 1, D:\a\winlib-builder\winlib-builder\libzstd\build\cmake\lib\RelWithDebInfo\libzstd.pdb

Either way, all one can say is we tried our best when tackling this ZSTD issue. It's just there's always another bug/idiosyncracy/compatibility issue.

However, it would be a relatively simple change to update the AL build of ZSTD to change the name from zstd.dll/zstd.lib to libzstd.dll/libzstd.lib, e.g.:
Code:
[ 41%] Built target libzstd_shared
[ 81%] Built target libzstd_static
[100%] Built target zstd
Install the project...
-- Install configuration: "Release"
-- Installing: C:/Apache24/lib/pkgconfig/libzstd.pc
-- Installing: C:/Apache24/include/zdict.h
-- Installing: C:/Apache24/include/zstd.h
-- Installing: C:/Apache24/include/zstd_errors.h
-- Installing: C:/Apache24/lib/libzstd.lib
-- Installing: C:/Apache24/bin/libzstd.dll
-- Installing: C:/Apache24/lib/zstd_static.lib
-- Installing: C:/Apache24/bin/zstd.exe
-- Installing: C:/Apache24/lib/cmake/zstd/zstdTargets.cmake
-- Installing: C:/Apache24/lib/cmake/zstd/zstdTargets-release.cmake
-- Installing: C:/Apache24/lib/cmake/zstd/zstdConfig.cmake
-- Installing: C:/Apache24/lib/cmake/zstd/zstdConfigVersion.cmake

Going forward, in the interest of PHP compatibility, we'll have to see if Steffen would be happy to accept this change to the AL build.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3205
Location: Hilversum, NL, EU

PostPosted: Fri 19 Jun '26 7:13    Post subject: Reply with quote

First try copy zstd.dll to libzstd.dll to see if that works.

I want first the reason why PHP builds libzstd.dll ?
Back to top
danielruf



Joined: 07 Jan 2026
Posts: 24

PostPosted: Fri 19 Jun '26 8:07    Post subject: Reply with quote

Frankly I can not answer, why PHP builds libzstd.dll. As far as I understood, they statically build and include the library via cmake or something like that.

Good news is, that it should not happen with the next PHP release, see https://github.com/php/php-src/issues/22359#issuecomment-4745323072

* copied the file as mentioned in apache/bin (zstd.dll => libzstd.dll).
* removed LoadFile "${basePath}/php/libzstd.dll" from my httpd.conf.
* restarted the Apache service
* reloaded page with phpinfo output
* curl is successfully loaded now

So it seems it is connected to the lib* => * renaming. Something similar happenend with zlib. Why that is so? I don't know.

To me as someone from the outside it looks like this:
* curl changed their requirements (breaking change imho, made in a minor update)
* the whole ecosystem has to adapt (PHP, Apache and likely other distros, packages, ...)

Not sure if and how well this was communicated in the ecosystem.
Back to top
tangent
Moderator


Joined: 16 Aug 2020
Posts: 458
Location: UK

PostPosted: Fri 19 Jun '26 11:21    Post subject: Reply with quote

Thanks to you and @Jan-E for following this through with the PHP developers so quickly, and yes, it looks like their solution going forward will be to link with ZSTD statically. So there will be no need to change the ZSTD names in the Apache Lounge build.

What's interesting in looking through the PHP post is reference to winlib-builder patch https://github.com/winlibs/winlib-builder/blob/master/patches/libzstd.patch, where a decision was made to change the ZSTD library names from zstd to libzstd. This is what has caused this issue, in a similar way to the problems ZLIB caused by changing the names of their libraries in their most recent update.

The downside of linking things statically is program sizes and memory requirements go up; like most things in life it's a compromise.

Regarding the 'ecosystem' needing to adapt, we are looking at the Open Source movement. There are some really clever guys out there, who as developers choose to give their own time and expertise in co-operative ventures to the best of their abilities. I take my hat off to them.
Back to top


Reply to topic   Topic: PHP 8.5.7 and curl 8.20.0 require loading of brotli and zstd View previous topic :: View next topic
Post new topic   Forum Index -> Other Software