Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken curl extension in PHP 8.3.2 on Windows #13303

Closed
Eccenux opened this issue Feb 1, 2024 · 5 comments
Closed

Broken curl extension in PHP 8.3.2 on Windows #13303

Eccenux opened this issue Feb 1, 2024 · 5 comments

Comments

@Eccenux
Copy link

Eccenux commented Feb 1, 2024

Description

Cannot get curl to load at all. Used to have problems with ldap and openssl, bu they load fine after adding LoadFile "${MY_PHP_ROOT}/libssl-3-x64.dll" I think.

Configuration

php.ini:

extension=php_curl.dll
[curl]
curl.cainfo = c:\Prog\PHPs\cacert.pem

apache httpd.conf:

##
#BEGIN PHP
Define MY_PHP_ROOT "c:/Prog/PHPs/PHP83"

# Load libraries that might be required for PHP extensions (curl, openssl, ldap)
LoadFile "${MY_PHP_ROOT}/glib-2.dll"
LoadFile "${MY_PHP_ROOT}/gmodule-2.dll"
LoadFile "${MY_PHP_ROOT}/icudt72.dll"
LoadFile "${MY_PHP_ROOT}/icuin72.dll"
LoadFile "${MY_PHP_ROOT}/icuio72.dll"
LoadFile "${MY_PHP_ROOT}/icuuc72.dll"
LoadFile "${MY_PHP_ROOT}/libcrypto-3-x64.dll"
LoadFile "${MY_PHP_ROOT}/libenchant2.dll"
LoadFile "${MY_PHP_ROOT}/libpq.dll"
LoadFile "${MY_PHP_ROOT}/libsasl.dll"
LoadFile "${MY_PHP_ROOT}/libsodium.dll"
LoadFile "${MY_PHP_ROOT}/libsqlite3.dll"
LoadFile "${MY_PHP_ROOT}/libssh2.dll"
LoadFile "${MY_PHP_ROOT}/libssl-3-x64.dll"

AddHandler application/x-httpd-php .php
AddType application/x-httpd-php .php .html
LoadModule php_module "${MY_PHP_ROOT}/php8apache2_4.dll"
PHPIniDir "${MY_PHP_ROOT}/apache_ini/"

#END PHP
##

Resulted in this output:

[01-Feb-2024 15:56:31 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: c:/Prog/PHPs/PHP83/ext\curl (Nie można odnaleźć określonego modułu), c:/Prog/PHPs/PHP83/ext\php_curl.dll (Nie można odnaleźć określonego modułu)) in Unknown on line 0
[01-Feb-2024 15:56:33 UTC] PHP Warning:  PHP Startup: Unable to load dynamic library 'curl' (tried: c:/Prog/PHPs/PHP83/ext\curl (Nie można odnaleźć określonego modułu), c:/Prog/PHPs/PHP83/ext\php_curl.dll (Nie można odnaleźć określonego modułu)) in Unknown on line 0

But I expected this output instead:

No bugz :) (or a helpful message at least, see separate report: #13302)

PHP Version

PHP 8.3.2

Operating System

Windows 10 22H2

@nielsdos
Copy link
Member

nielsdos commented Feb 1, 2024

It works on my machine with the CLI SAPI.
Are you getting your PHP binaries from https://windows.php.net or elsewhere?
Also, can you please confirm whether it works in CLI?
Also, this heavily reminds me of #12491 (might be helpful)

@Eccenux
Copy link
Author

Eccenux commented Feb 1, 2024

Hi. I've got standard PHP build php-8.3.2-Win32-vs16-x64.zip. And Apache from https://www.apachelounge.com/download/
...
Upgrading to Apache 2.4.58 did the trick 🥳. Thank you for your help 🙂

This table was crucial:
#12491 (comment)

@Eccenux
Copy link
Author

Eccenux commented Feb 1, 2024

Oh and only those two libraries are needed:

# Load libraries required for PHP extensions (curl, openssl, ldap)
LoadFile "${MY_PHP_ROOT}/libssh2.dll"
LoadFile "${MY_PHP_ROOT}/libssl-3-x64.dll"

In PHP7 it was only:

LoadFile "${MY_PHP_ROOT}/libssh2.dll"

@verybigelephants
Copy link

verybigelephants commented Feb 20, 2024

I was also getting curl error

nghttp2_option_set_no_rfc9113_leading_and_trailing_ws_validation could not be loated in the dynamic library ...php-8.3.3-Win32-vs16-x64\ext\php_curl.dll

thank you @Eccenux

@inri13666
Copy link

Hi. I've got standard PHP build php-8.3.2-Win32-vs16-x64.zip. And Apache from https://www.apachelounge.com/download/ ... Upgrading to Apache 2.4.58 did the trick 🥳.

thank you @Eccenux :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants